>From section 14.1 of
http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&cache=cache&media=es3.1:es5-tc392008-040.pdf
A Directive Prologue is a sequence of zero or more
ExpressionStatement productions,
each of which having an Expression consists entirely of a
StringLiteral, that occur as the initial
SourceElement productions of a Program or FunctionBody.
What does "consists entirely" mean?
>From the grammar in the appendix, to get from ExpressionStatement to
StringLiteral, I have to go through the following grammar chain:
ExpressionStatement -> AssignmentExpression ->
ConditionalExpression -> (lots of operator precedence elided)
-> LeftHandSideExpression -> NewExpression -> MemberExpression ->
PrimaryExpression -> Literal -> StringLiteral
One way to define "consists entirely" might be: an A that consists
entirely of B if it matches A and B and all tokens were consumed by
matching B.
That definition is consistent with
"use strict"
but not
"use strict";
since the ";" is actually part of the ExpressionStatement production.
Is there a definition of "consists entirely" that matches
"use strict";
and
"use strict"
but not
("use strict");
?
Or can the last be part of a directive prologue?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss