Refutable pattern

Brendan Eich brendan at
Fri Feb 1 12:45:06 PST 2013

Brendan Eich wrote:
> One solution already used in ECMA-262 to regain LR(1) parsing of the 
> standard grammar is lookahead restriction. Observe that with 
> postfix-'?' in patterns, the legal lookahead set is {'=', ':' , ',', 
> '}', ']'}. So we could simply write a lookahead restriction.

Amended per the formal parameter case that Claude Pache provoked me to 

   lookahead not in {'=', ':' , ',', '}', ']', ')'}

after the postfix-'?' optionally following an object or array literal in 
the main (cover) grammar.


More information about the es-discuss mailing list