From: Jay Freeman (saurik) Date: Wed, 16 Dec 2015 13:41:41 +0000 (-0800) Subject: Move return lexer hack to grammar semantic action. X-Git-Tag: v0.9.590~199 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/30446af8f177a467301160170873de6c77bb44d1 Move return lexer hack to grammar semantic action. --- diff --git a/Parser.ypp.in b/Parser.ypp.in index b85edf6..5075537 100644 --- a/Parser.ypp.in +++ b/Parser.ypp.in @@ -142,11 +142,6 @@ _finline int yylex(cy::parser::semantic_type *semantic, CYLocation *location, CY token = tk::_in__; break; - case tk::_return_: - if (driver.return_.top()) - token = tk::_return__; - break; - case tk::_yield_: if (driver.yield_.top()) token = tk::_yield__; @@ -376,7 +371,6 @@ _finline int yylex(cy::parser::semantic_type *semantic, CYLocation *location, CY %token _instanceof_ "instanceof" %token _new_ "new" %token _return_ "return" -%token _return__ "!return" %token _super_ "super" %token _switch_ "switch" %token _target_ "target" @@ -791,7 +785,6 @@ Word | "new" LexSetRegExp { $$ = CYNew CYWord("new"); } | "null" { $$ = CYNew CYWord("null"); } | "return" { $$ = CYNew CYWord("return"); } - | "!return" { $$ = CYNew CYWord("return"); } | "super" { $$ = CYNew CYWord("super"); } | "switch" { $$ = CYNew CYWord("switch"); } | "this" { $$ = CYNew CYWord("this"); } @@ -1523,7 +1516,7 @@ BreakStatement /* }}} */ /* 13.10 The return Statement {{{ */ Return - : "!return" LexNewLine + : "return" { if (!driver.return_.top()) CYERR(@1, "invalid return"); } LexNewLine ; ReturnStatement