On Apr 7, 2012, at 1:40 PM, Erik Arvidsson wrote:

> This does not work for rest parameter since ... is only allowed inside
> array literals.
> 
> var tail = (x, ...xs) => xs;
> 
> This can of course be solved in numerous ways but it is not true that
> the Expression is a cover grammar for FormalParameterList.
> 
> Another option is to allow ...expression in an expression which would
> have the same semantics as a comma expression where the expression has
> been spread:

Or allow it in the grammar and then disallow it in the post-processing. IOW, a 
cover grammar doesn't have to force us to introduce new syntactic forms, they 
just force us to put them in the *grammar*. The post-processing, which 
essentially defines the two sub-grammars for the two separate contexts, can 
remove the syntactic forms we don't want to provide semantics for.

Dave

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to