From 1d5e845a26a006ed88985816d86a5769b6a713b0 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 1 Dec 2015 16:44:37 -0800 Subject: [PATCH] Avoid ECMAScript6 conflicts with RubyBlock syntax. --- Cycript.yy.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Cycript.yy.in b/Cycript.yy.in index f025f6a..1ff6736 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -576,7 +576,7 @@ _finline int yylex(cy::parser::semantic_type *semantic, CYLocation *location, vo /* }}} */ /* Token Priorities {{{ */ %nonassoc "" -%left "++" "--" +%left "++" "--" "{" %nonassoc "if" %nonassoc "else" @@ -1990,12 +1990,12 @@ RubyProcParameterList ; RubyProcParameters - : "|" RubyProcParameterList "|" { $$ = $2; } - | "||" { $$ = NULL; } + : LexSetRegExp "|" RubyProcParameterList "|" { $$ = $3; } + | LexSetRegExp "||" { $$ = NULL; } ; RubyProcParametersOpt - : RubyProcParameters + : RubyProcParameters { $$ = $1; } | { $$ = NULL; } ; @@ -2004,11 +2004,11 @@ RubyProcExpression ; PrimaryExpression - : "{" LexPushInOff RubyProcParameters StatementListOpt "}" LexPopIn { $$ = CYNew CYRubyProc($3, $4); } + : BRACE LexPushInOff RubyProcParameters StatementListOpt "}" LexPopIn { $$ = CYNew CYRubyProc($3, $4); } ; -CallExpression - : CallExpression_ RubyProcExpression { $$ = CYNew CYRubyBlock($1, $2); } +PostfixExpression + : LeftHandSideExpression RubyProcExpression { $$ = CYNew CYRubyBlock($1, $2); } ; /* }}} */ -- 2.45.2