]> git.saurik.com Git - cycript.git/commitdiff
Allow of to be used as Identifier, not just Word.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jun 2012 19:59:38 +0000 (12:59 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jun 2012 19:59:38 +0000 (12:59 -0700)
Cycript.l.in
Cycript.yy.in

index d71411088fcea020526b3ecac2725f4e2d925e54..953264b3ae5876b25d6e6464f0a7aa12f0caca22 100644 (file)
@@ -275,7 +275,6 @@ XMLName {XMLNameStart}{XMLNamePart}*
 "in"           L C I(word, Word("in"), yyextra->in_.top() ? tk::In_ : tk::In);
 "instanceof"   L C I(word, Word("instanceof"), tk::InstanceOf);
 "new"          L C I(word, Word("new"), tk::New);
-"of"           L C I(word, Word("of"), tk::Of);
 "return"       L R I(word, Word("return"), tk::Return);
 "switch"       L C I(word, Word("switch"), tk::Switch);
 "this"         L C I(this, This(), tk::This);
@@ -327,6 +326,7 @@ XMLName {XMLNameStart}{XMLNamePart}*
 "yield"        L C I(identifier, Identifier("yield"), tk::Yield);
 
 "each"         L C I(identifier, Identifier("each"), tk::Each);
+"of"           L C I(identifier, Identifier("of"), tk::Of);
 
 @begin E4X
 "namespace"    L C I(identifier, Identifier("namespace"), tk::Namespace);
index dc2a512c231f9158a83c5241b4d2c0df0620871d..53d4d5daeaae1dea914f0c74e6282bfc39a5d44e 100644 (file)
@@ -250,7 +250,6 @@ int cylex(YYSTYPE *, cy::location *, void *);
 %token <word_> In_ "!in"
 %token <word_> InstanceOf "instanceof"
 %token <word_> New "new"
-%token <word_> Of "of"
 %token <word_> Return "return"
 %token <word_> Switch "switch"
 %token <this_> This "this"
@@ -309,6 +308,7 @@ int cylex(YYSTYPE *, cy::location *, void *);
 
 // Woah?!
 %token <identifier_> Each "each"
+%token <identifier_> Of "of"
 
 @begin E4X
 // E4X Conditional
@@ -598,7 +598,6 @@ Word
 
     | "new" { $$ = $1; }
     | "null" { $$ = $1; }
-    | "of" { $$ = $1; }
     | "return" NewLineOpt { $$ = $1; }
     | "super" { $$ = $1; }
     | "switch" { $$ = $1; }
@@ -660,6 +659,7 @@ Identifier
     | "yield" { $$ = $1; }
 
     | "each" { $$ = $1; }
+    | "of" { $$ = $1; }
     ;
 
 IdentifierOpt