2011/3/27 Wes Garland <[email protected]>: > On Sat, Mar 26, 2011 at 10:44 PM, Brendan Eich <[email protected]> wrote: > FunctionExpression : > function Identifieropt ( FormalParameterListopt ) { FunctionBody } > or > `Identifieropt FormalParameterListopt { FunctionBody }` > ..although my "native thought pattern" is definitely LALR(1). I find LL(k) > ambiguities hard to spot, not having worked with a top-down parser-generator > since I was in school! Argh, now I'm not sure if that grammar is > unambiguous for small k due to nested FunctionExpressions. I don't think > there is a comma-expression hazard there, though.
The need to balance the curly brackets in the body makes it unambiguous for nested function expressions. You don't need to look ahead to tell whether a back-tick is an opening or closing back-tick, just remember whether the last-non-comment-non-whitespace token was a close curly that closed a function expression's body. It is ambiguous with http://wiki.ecmascript.org/doku.php?id=strawman:quasis#syntax_normative if quasi type tags are optional. _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

