From d7205a63aaba9ede0fa1b6ba26143e0483ffe6c3 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 23 May 2011 09:07:37 +0000 Subject: [PATCH] Implement more syntax from strawman:block_lambda_revival. --- Cycript.yy.in | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Cycript.yy.in b/Cycript.yy.in index b40c348..925481a 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 @@ -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); } ; -- 2.45.2