'function *' is not mandatory

Brendan Eich brendan at mozilla.com
Mon Sep 2 00:49:58 PDT 2013


Jussi Kalliokoski wrote:
> Is the star after yield any less arbitrary?

Not much -- it conjures Kleene's star, worth something (not much? enough!).

>     Your comments on the grammar show continued informality and lack
>     of familiarity with parsing theory in general, and the ECMA-262
>     grammar formalisms in particular.
>
>
> They probably do since I am not familiar with parsing theory in 
> general, but I probably represent a large portion of the community 
> with that disability (which I hope to repair at some point). I 
> wouldn't ask the questions if I knew the answers, now would I. To me 
> this seems just like arbitrary limitations where it's somehow 
> impossible to add an if statement in the parser.

We don't want to mess around with ambiguity. The smell of a suffix 
character for function is strictly less than the smell of a sub-grammar 
for 'generator' distinct from other identifiers, with newline sensitivity.

>
>     We don't want to split 'generator' out from Identifier, and
>     special-case its syntax in PrimaryExpressions (which must be
>     covered by a cover-grammar that also covers destructuring). We
>     don't have a convenient formalism for such special-casing.
>
>
> All right, so it would be a much larger effort to specify it?

The work involves splitting Identifier :: IdentifierName but not 
ReservedWord into 'generator' | IdentifierNotGenerator and adding 
IdentifierNotGenerator :: IdentifierName but not ('generator' or 
ReservedWord), then splitting Identifier uses and coping with the cover 
grammar complexity. I haven't done the work to make sure it's sound. 
Much bigger fish to fry, rotten smell already.

/be


More information about the es-discuss mailing list