]> git.saurik.com Git - cycript.git/commitdiff
Fix regex literal parse after return, throw, and =>.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 23 Sep 2012 14:52:02 +0000 (07:52 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 23 Sep 2012 15:53:51 +0000 (08:53 -0700)
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 {{{ */