X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/496f6076504c3575ac26387c3f928faa63eae01f..fb726fc55e2a79b03564be97d5057e28805d84f0:/Cycript.yy.in diff --git a/Cycript.yy.in b/Cycript.yy.in index b40c348..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 @@ -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); } ;