]> git.saurik.com Git - cycript.git/blobdiff - Cycript.yy.in
Fix regex literal parse after return, throw, and =>.
[cycript.git] / Cycript.yy.in
index 684463d5ec0b98f0a2919e543a5e4133a11fb58e..465dd45c8235880afb1a229e18b41909e135e39f 100644 (file)
@@ -1213,7 +1213,7 @@ BreakStatement
 /* }}} */
 /* 12.9 The return Statement {{{ */
 ReturnStatement
-    : "return" "\n" StrictSemi { $$ = CYNew CYReturn(NULL); }
+    : "return" LexSetRegExp "\n" StrictSemi { $$ = CYNew CYReturn(NULL); }
     | "return" ExpressionOpt Terminator { $$ = CYNew CYReturn($2); }
     ;
 /* }}} */
@@ -1253,7 +1253,7 @@ LabelledStatement
 /* }}} */
 /* 12.13 The throw Statement {{{ */
 ThrowStatement
-    : "throw" "\n" StrictSemi { YYABORT; }
+    : "throw" LexSetRegExp "\n" StrictSemi { YYABORT; }
     | "throw" Expression Terminator { $$ = CYNew cy::Syntax::Throw($2); }
     ;
 /* }}} */
@@ -1326,7 +1326,7 @@ ArrowParameters
 
 ConciseBody
     : AssignmentExpression { $$ = CYNew CYReturn($1); }
-    | ";{" LexPushInOff FunctionBody LexPopIn "}" { $$ = $3; }
+    | LexSetRegExp ";{" LexPushInOff FunctionBody LexPopIn "}" { $$ = $4; }
     ;
 /* }}} */
 /* 14 Program {{{ */