From: Jay Freeman (saurik) Date: Wed, 2 Dec 2015 00:44:37 +0000 (-0800) Subject: Avoid ECMAScript6 conflicts with RubyBlock syntax. X-Git-Tag: v0.9.590~254 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/1d5e845a26a006ed88985816d86a5769b6a713b0?ds=sidebyside Avoid ECMAScript6 conflicts with RubyBlock syntax. --- 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); } ; /* }}} */