optional "function" keyword

John Tamplin jat at google.com
Thu Mar 8 11:35:06 PST 2012

On Thu, Mar 8, 2012 at 1:08 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Another which I cited just a few messages back: parsing ( params ) as (
> expr ), as any top down parser must until it gets to an arrow or other
> distinguishing token ({ on same line as ), e.g.), can be considered
> future-hostile. params should be declarative, but expr must now cover all
> future declarative syntax, including optional guards.

For this particular problem, the Dart parser looks ahead to see if it could
be a function declaration.  If so, it parses it that way, otherwise it
parses as a parenthesized expression.  I don't know if this sort of
approach would be considered acceptable here or not (it does impose some
restrictions on the scanner for n-token lookahead).

John A. Tamplin
Software Engineer (GWT), Google
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120308/7a751dfd/attachment-0001.html>

More information about the es-discuss mailing list