A few grammar comments on the 12 Jan draft

Waldemar Horwat waldemar at google.com
Mon Jan 26 17:49:29 PST 2009


7:  Should we replace the two instances of LineTerminator in the grammar at the beginning of the chapter to LineTerminatorSequence?  It doesn't make any difference as far as the grammar is concerned, other than implying unwritten expectations for counting line numbers.  The downside is that this would ripple through the document, forcing similar renames in things like the discussion of restricted productions and semicolon insertion.  Probably not worth it.

7.8.4:  "The SV of LineContinuation :: \ LineTerminator":  LineTerminator -> LineTerminatorSequence

7.8.5:  The new grammar is broken.  It disallows things such as [], which are allowed by the regexp grammar.  Also, [^x] is ambiguous -- the ^ could be a character or a negation operator.  [^-x] is also ambiguous and could lex in a couple different ways.

The best fix would be not to try to parse the insides of character classes.  Instead, after a [, allow zero or more characters (including / but excluding \ or ]) or escape sequences, until reaching the next ].

14:  UseStrictDirective is not well-formed because it's part of the syntactic grammar but not composed of lexer tokens.


    Waldemar


More information about the Es-discuss mailing list