]> git.saurik.com Git - cycript.git/commitdiff
A !in token should technically count as a Word.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jun 2012 20:19:24 +0000 (13:19 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jun 2012 20:19:24 +0000 (13:19 -0700)
Cycript.yy.in

index 53d4d5daeaae1dea914f0c74e6282bfc39a5d44e..be279e5d7c15e92111f139cc6e6898a9cccc925a 100644 (file)
@@ -382,6 +382,7 @@ int cylex(YYSTYPE *, cy::location *, void *);
 %type <expression_> FunctionExpression
 %type <identifier_> Identifier
 %type <identifier_> IdentifierOpt
+%type <word_> IdentifierName
 %type <comprehension_> IfComprehension
 %type <statement_> IfStatement
 %type <expression_> Initialiser
@@ -439,6 +440,8 @@ int cylex(YYSTYPE *, cy::location *, void *);
 %type <declarations_> VariableDeclarationList
 %type <statement_> VariableStatement
 %type <statement_> WithStatement
+%type <word_> Word
+%type <word_> WordOpt
 
 @begin ObjectiveC
 %type <statement_> CategoryStatement
@@ -468,8 +471,6 @@ int cylex(YYSTYPE *, cy::location *, void *);
 %type <word_> SelectorWordOpt
 %type <expression_> TypeOpt
 %type <argument_> VariadicCall
-%type <word_> Word
-%type <word_> WordOpt
 @end
 
 @begin E4X
@@ -562,12 +563,15 @@ TerminatorOpt
     |
     ;*/
 
-@begin ObjectiveC
 NewLineOpt
     : "\n"
     |
     ;
 
+IdentifierName
+    : Word { $$ = $1; }
+    ;
+
 Word
     : Identifier { $$ = $1; }
     | "break" NewLineOpt { $$ = $1; }
@@ -591,6 +595,7 @@ Word
     | "if" { $$ = $1; }
     | "import" { $$ = $1; }
     /* XXX: | "in" { $$ = $1; } */
+    | "!in" { $$ = $1; }
     /* XXX: | "instanceof" { $$ = $1; } */
 
     // XXX: as it currently is not an Identifier
@@ -617,6 +622,7 @@ WordOpt
     | { $$ = NULL; }
     ;
 
+@begin ObjectiveC
 PrimaryExpression
     : "@" LiteralNoRE { $$ = CYNew CYBox($2); }
     | "@" ArrayLiteral { $$ = CYNew CYBox($2); }
@@ -753,7 +759,7 @@ PropertyNameAndValueListOpt
     ;
 
 PropertyName_
-    : Identifier { $$ = $1; }
+    : IdentifierName { $$ = $1; }
     | StringLiteral { $$ = $1; }
     | NumericLiteral { $$ = $1; }
     ;