From: Jay Freeman (saurik) Date: Sun, 23 Sep 2012 14:52:02 +0000 (-0700) Subject: Fix regex literal parse after return, throw, and =>. X-Git-Tag: v0.9.500%b1~127 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/e0815d86d21e1e48ed89ff3c1dd37a73a91170fa Fix regex literal parse after return, throw, and =>. --- diff --git a/Cycript.yy.in b/Cycript.yy.in index 684463d..465dd45 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -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 {{{ */