Use subset directive grammar

Allen Wirfs-Brock Allen.Wirfs-Brock at
Mon Sep 21 19:55:23 PDT 2009

Nice looks like I need to mention the semicolon (which may be supplied by automatic semicolon insertion).

The parentheses form is not intended to be a directive.


>-----Original Message-----
>From: es-discuss-bounces at [mailto:es-discuss-
>bounces at] On Behalf Of Mike Samuel
>Sent: Monday, September 21, 2009 6:33 PM
>To: es-discuss at
>Subject: Use subset directive grammar
>From section 14.1 of
>    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";
>  "use strict"
>but not
>  ("use strict");
>Or can the last be part of a directive prologue?
>es-discuss mailing list
>es-discuss at

More information about the es-discuss mailing list