Andrew Fedoniouk wrote:
As I said that requires one token lookahead:
name ':' while|for|do -> labeled statement, else
name ':' ArgumentList -> function call
In fact there's no restriction in LabelledStatement that only loops come
after the label and colon. For one think, break to label can occur in an
'if' or block statement. Another point: on the web, accidental
javascript: labels creep from URLs into code. These have been observed.
They generally label expression statements, which may be parenthesized
at the start.
The main problem may arise with '?' operator though.
var r = cond ? name1 : name2;
Such function call has to have less precedence than the '?' to keep
existing code correct.
Write the grammar in full, then argue it's simpler than alternatives.
For now you seem to be tilting at windmills still.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss