From 480c883406d1c5eab16d53945b37760489490f33 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 7 Jun 2012 12:59:38 -0700 Subject: [PATCH] Allow of to be used as Identifier, not just Word. --- Cycript.l.in | 2 +- Cycript.yy.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cycript.l.in b/Cycript.l.in index d714110..953264b 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -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); diff --git a/Cycript.yy.in b/Cycript.yy.in index dc2a512..53d4d5d 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -250,7 +250,6 @@ int cylex(YYSTYPE *, cy::location *, void *); %token In_ "!in" %token InstanceOf "instanceof" %token New "new" -%token Of "of" %token Return "return" %token Switch "switch" %token This "this" @@ -309,6 +308,7 @@ int cylex(YYSTYPE *, cy::location *, void *); // Woah?! %token Each "each" +%token 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 -- 2.45.2