X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/039ea0ce2f7197c9dae2382e09cfdfb0ddf6021e..fb726fc55e2a79b03564be97d5057e28805d84f0:/Cycript.yy.in diff --git a/Cycript.yy.in b/Cycript.yy.in index 22a601a..f289f76 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -437,8 +437,10 @@ int cylex(YYSTYPE *, cy::location *, void *); %type RelationalExpressionNoIn_ %type ReturnStatement %type RubyProcExpression +%type RubyProcExpressionNoOA %type RubyProcParameterList %type RubyProcParameterList_ +%type RubyProcParameters %type RubyProcParametersOpt %type ShiftExpression %type ShiftExpressionNoBF @@ -759,7 +761,7 @@ ElementList /* }}} */ /* 11.1.5 Object Initialiser {{{ */ ObjectLiteral - : OpenBrace PropertyNameAndValueListOpt "}" { $$ = CYNew CYObject($2); } + : Brace PropertyNameAndValueListOpt "}" { $$ = CYNew CYObject($2); } ; PropertyNameAndValueList_ @@ -1592,7 +1594,7 @@ ClassStatement ; CategoryName - : "(" Word ")" + : "(" WordOpt ")" ; CategoryStatement @@ -1937,8 +1939,13 @@ RubyProcParameterList | { $$ = NULL; } ; -RubyProcParametersOpt +RubyProcParameters : "|" RubyProcParameterList "|" { $$ = $2; } + | "||" { $$ = NULL; } + ; + +RubyProcParametersOpt + : RubyProcParameters | { $$ = NULL; } ; @@ -1946,6 +1953,14 @@ RubyProcExpression : "{" RubyProcParametersOpt StatementListOpt "}" { $$ = CYNew CYRubyProc($2, $3); } ; +RubyProcExpressionNoOA + : "{" RubyProcParameters StatementListOpt "}" { $$ = CYNew CYRubyProc($2, $3); } + ; + +PrimaryExpressionNo + : RubyProcExpressionNoOA { $$ = $1; } + ; + LeftHandSideExpression : LeftHandSideExpression RubyProcExpression { $$ = CYNew CYRubyBlock($1, $2); } ;