From e0815d86d21e1e48ed89ff3c1dd37a73a91170fa Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 23 Sep 2012 07:52:02 -0700 Subject: [PATCH] Fix regex literal parse after return, throw, and =>. --- Cycript.yy.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 {{{ */ -- 2.45.2