Permalink
Browse files

Allow reserved words in a few identifier positions.

  • Loading branch information...
1 parent 35f58d2 commit 62023bc70d348bfaf409d402489fdfe30b22e4ef @bobmcwhirter bobmcwhirter committed Oct 15, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/main/antlr3/org/dynjs/parser/ES3.g
@@ -947,6 +947,7 @@ propertyName
: Identifier
| StringLiteral
| numericLiteral
+ | reservedWord -> ^(Identifier[$reservedWord.text])
;
propertyGet
@@ -995,6 +996,7 @@ leftHandSideExpression
arguments -> ^( CALL $leftHandSideExpression arguments )
| LBRACK expression RBRACK -> ^( BYINDEX $leftHandSideExpression expression )
| DOT Identifier -> ^( BYFIELD $leftHandSideExpression Identifier )
+ | DOT reservedWord -> ^( BYFIELD $leftHandSideExpression ^( Identifier[$reservedWord.text] ) )
)*
;

0 comments on commit 62023bc

Please sign in to comment.