arrow syntax unnecessary and the idea that "function" is too long
Brendan Eich
brendan at mozilla.com
Sun May 15 10:26:44 PDT 2011
On May 14, 2011, at 11:33 PM, Brendan Eich wrote:
> Grammar Changes
> Change all uses of AssignmentExpression outside of the Expression sub-grammar to InitialExpression:
>
> ...
> ArrowFunctionExpression :
> FormalParametersOpt Arrow [lookahead ∉ {{}] InitialExpression
> FormalParametersOpt Arrow Block
>
> FormalParameters :
> ( FormalParameterListOpt )
Forgot to include the optional leading |this| parameter, so the above two production-sets should be:
ArrowFunctionExpression :
ArrowFormalParametersOpt Arrow [lookahead ∉ {{}] InitialExpression
ArrowFormalParametersOpt Arrow Block
ArrowFormalParameters :
( FormalParameterListOpt )
( this InitialiserOpt )
( this InitialiserOpt , FormalParameterList )
("Opt" at the end is because I can't get dokuwiki to do a subscripted "opt" as ES1-5's grammars do for optional right-hand side terms -- at least not without a dokuwiki plugin.)
/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110515/a100d7bf/attachment.html>
More information about the es-discuss
mailing list