Nannying (was: Array comprehension syntax)
brendan at mozilla.com
Tue Sep 25 13:30:13 PDT 2012
Allen Wirfs-Brock wrote:
> I think we should go the all AssignmentExpression route. It avoid ArrayLiteral-like comma confusion in all three positions. It is also a simpler set of rules to teach and remember.
It's different from the statement forms, though.
Again, this is a non-issue in practice. Nobody writes comma expressions
in those places.
> Finally, it leave open the future possibility of ArrayLiterals that have comprehensions in element positions. (not that I'm recommending this...)
Why wouldn't comprehensions be allowed in ArrayLiteral element
positions? That falls out of any grammar that puts comprehensions at
PrimaryExpression precedence, where they must be.
This is not a huge deal and I defer to Jason as champion-apparent, but
it does seem worth agreeing on the same Expression non-terminal for if
and for conditions in both statements and comprehensions, or finding a
better reason to change in the latter.
More information about the es-discuss