From 4492c19cf3035bedca4ec316197274fdddfcfeb2 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 7 Jun 2012 13:19:24 -0700 Subject: [PATCH] A !in token should technically count as a Word. --- Cycript.yy.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Cycript.yy.in b/Cycript.yy.in index 53d4d5d..be279e5 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -382,6 +382,7 @@ int cylex(YYSTYPE *, cy::location *, void *); %type FunctionExpression %type Identifier %type IdentifierOpt +%type IdentifierName %type IfComprehension %type IfStatement %type Initialiser @@ -439,6 +440,8 @@ int cylex(YYSTYPE *, cy::location *, void *); %type VariableDeclarationList %type VariableStatement %type WithStatement +%type Word +%type WordOpt @begin ObjectiveC %type CategoryStatement @@ -468,8 +471,6 @@ int cylex(YYSTYPE *, cy::location *, void *); %type SelectorWordOpt %type TypeOpt %type VariadicCall -%type Word -%type 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; } ; -- 2.47.2