Skip to content

Instantly share code, notes, and snippets.

@RReverser
Created October 16, 2015 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RReverser/d524c3f4b760fe136e44 to your computer and use it in GitHub Desktop.
Save RReverser/d524c3f4b760fe136e44 to your computer and use it in GitHub Desktop.
Example #1:
ArrayLiteral[Yield] :
[ Elision[opt] ]
[ ElementList[?Yield] ]
[ ElementList[?Yield] , Elision[opt] ]
Option #1:
ArrayLiteral :
[ Elision[opt] ]
[ ]
[ , Elision[opt] ]
ArrayLiteral_Yield :
[ Elision[opt] ]
[ ElementList ]
[ ElementList , Elision[opt] ]
Option #2:
ArrayLiteral :
[ Elision[opt] ]
ArrayLiteral_Yield :
/* same as #1 */
Example #2:
ParenthesizedExpression[Yield] :
( Expression[In, ?Yield] )
Option #1:
ParenthesizedExpression :
( ) // but this is not a valid parenthesized expression, right?
ParenthesizedExpression_Yield :
( Expression_In )
Option #2:
ParenthesizedExpression :
/* doesn't match anything */
ParenthesizedExpression_Yield:
( Expression_In )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment