From 66a93ac35b77404909250d92355e0613f82686dd Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Fri, 16 Nov 2018 00:36:11 +0000 Subject: [PATCH] Tweaking condition list lexer. --- re2c/bootstrap/src/ast/lex.cc | 1596 ++++++++++++++---------------- re2c/bootstrap/src/ast/parser.cc | 9 +- re2c/src/ast/lex.re | 23 +- re2c/src/ast/parser.ypp | 1 + 4 files changed, 769 insertions(+), 860 deletions(-) diff --git a/re2c/bootstrap/src/ast/lex.cc b/re2c/bootstrap/src/ast/lex.cc index e40c42e7..1375ec3d 100644 --- a/re2c/bootstrap/src/ast/lex.cc +++ b/re2c/bootstrap/src/ast/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Tue Nov 13 23:39:33 2018 */ +/* Generated by re2c 1.1.1 on Fri Nov 16 00:34:34 2018 */ #line 1 "../src/ast/lex.re" #include "src/util/c99_stdint.h" #include @@ -1703,7 +1703,7 @@ yy291: int Scanner::lex_clist() { int kind = TOKEN_CLIST; - CondList *cl = NULL; + CondList *cl = new CondList; #line 1709 "src/ast/lex.cc" { @@ -1756,7 +1756,7 @@ yy293: if (yych == '>') goto yy300; yy296: #line 345 "../src/ast/lex.re" - { goto fst; } + { goto cond; } #line 1761 "src/ast/lex.cc" yy297: ++YYCURSOR; @@ -1765,7 +1765,7 @@ yy297: if (yych == '\t') goto yy297; if (yych == ' ') goto yy297; #line 343 "../src/ast/lex.re" - { kind = TOKEN_CSETUP; goto fst; } + { kind = TOKEN_CSETUP; goto cond; } #line 1770 "src/ast/lex.cc" yy300: ++YYCURSOR; @@ -1775,30 +1775,29 @@ yy300: } #line 346 "../src/ast/lex.re" -fst: - cl = new CondList; +cond: tok = cur; -#line 1783 "src/ast/lex.cc" +#line 1782 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 0, 0, 0, 0, 0, 0, - 0, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 0, 0, 0, 0, 64, - 0, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 0, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 128, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1816,63 +1815,45 @@ fst: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 'Z') { if (yych == '*') goto yy306; - if (yych >= 'A') goto yy307; + if (yych >= 'A') goto yy308; } else { if (yych <= '_') { - if (yych >= '_') goto yy307; + if (yych >= '_') goto yy308; } else { if (yych <= '`') goto yy304; - if (yych <= 'z') goto yy307; + if (yych <= 'z') goto yy308; } } yy304: ++YYCURSOR; -yy305: -#line 353 "../src/ast/lex.re" +#line 352 "../src/ast/lex.re" { goto error; } -#line 1838 "src/ast/lex.cc" +#line 1836 "src/ast/lex.cc" yy306: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy310; - } - if (yych == '>') goto yy313; - goto yy305; -yy307: ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 64) { - goto yy307; - } -#line 352 "../src/ast/lex.re" - { cl->insert(std::string(tok, tok_len())); goto sep; } -#line 1855 "src/ast/lex.cc" -yy310: +#line 351 "../src/ast/lex.re" + { if (!cl->empty()) goto error; cl->insert("*"); goto next; } +#line 1841 "src/ast/lex.cc" +yy308: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy310; + goto yy308; } - if (yych == '>') goto yy313; - YYCURSOR = YYMARKER; - goto yy305; -yy313: - ++YYCURSOR; -#line 351 "../src/ast/lex.re" - { cl->insert("*"); goto end; } -#line 1870 "src/ast/lex.cc" +#line 350 "../src/ast/lex.re" + { cl->insert(std::string(tok, tok_len())); goto next; } +#line 1851 "src/ast/lex.cc" } -#line 354 "../src/ast/lex.re" +#line 353 "../src/ast/lex.re" -sep: +next: -#line 1876 "src/ast/lex.cc" +#line 1857 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1912,134 +1893,67 @@ sep: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= ' ') { - if (yych == '\t') goto yy319; - if (yych >= ' ') goto yy319; + if (yych == '\t') goto yy315; + if (yych >= ' ') goto yy315; } else { if (yych <= ',') { - if (yych >= ',') goto yy320; + if (yych >= ',') goto yy316; } else { - if (yych == '>') goto yy323; + if (yych == '>') goto yy319; } } ++YYCURSOR; -yy318: -#line 359 "../src/ast/lex.re" +yy314: +#line 358 "../src/ast/lex.re" { goto error; } -#line 1929 "src/ast/lex.cc" -yy319: +#line 1910 "src/ast/lex.cc" +yy315: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= ' ') { - if (yych == '\t') goto yy325; - if (yych <= 0x1F) goto yy318; - goto yy325; + if (yych == '\t') goto yy321; + if (yych <= 0x1F) goto yy314; + goto yy321; } else { if (yych <= ',') { - if (yych <= '+') goto yy318; + if (yych <= '+') goto yy314; } else { - if (yych == '>') goto yy323; - goto yy318; + if (yych == '>') goto yy319; + goto yy314; } } -yy320: +yy316: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy320; + goto yy316; } -#line 357 "../src/ast/lex.re" - { goto next; } -#line 1953 "src/ast/lex.cc" -yy323: +#line 356 "../src/ast/lex.re" + { goto cond; } +#line 1934 "src/ast/lex.cc" +yy319: ++YYCURSOR; -#line 358 "../src/ast/lex.re" +#line 357 "../src/ast/lex.re" { goto end; } -#line 1958 "src/ast/lex.cc" -yy325: +#line 1939 "src/ast/lex.cc" +yy321: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= ' ') { - if (yych == '\t') goto yy325; - if (yych >= ' ') goto yy325; + if (yych == '\t') goto yy321; + if (yych >= ' ') goto yy321; } else { if (yych <= ',') { - if (yych >= ',') goto yy320; + if (yych >= ',') goto yy316; } else { - if (yych == '>') goto yy323; + if (yych == '>') goto yy319; } } YYCURSOR = YYMARKER; - goto yy318; + goto yy314; } -#line 360 "../src/ast/lex.re" - -next: - tok = cur; - -#line 1981 "src/ast/lex.cc" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 128, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= '^') { - if (yych <= '@') goto yy330; - if (yych <= 'Z') goto yy332; - } else { - if (yych == '`') goto yy330; - if (yych <= 'z') goto yy332; - } -yy330: - ++YYCURSOR; -#line 365 "../src/ast/lex.re" - { goto error; } -#line 2031 "src/ast/lex.cc" -yy332: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy332; - } -#line 364 "../src/ast/lex.re" - { cl->insert(std::string(tok, tok_len())); goto sep; } -#line 2041 "src/ast/lex.cc" -} -#line 366 "../src/ast/lex.re" +#line 359 "../src/ast/lex.re" end: yylval.clist = cl; @@ -2052,7 +1966,7 @@ error: void Scanner::lex_cgoto() { -#line 2056 "src/ast/lex.cc" +#line 1970 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2089,25 +2003,25 @@ void Scanner::lex_cgoto() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - goto yy335; -yy336: + goto yy324; +yy325: ++YYCURSOR; -yy335: +yy324: if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy336; + goto yy325; } -#line 378 "../src/ast/lex.re" +#line 371 "../src/ast/lex.re" { goto name; } -#line 2104 "src/ast/lex.cc" +#line 2018 "src/ast/lex.cc" } -#line 379 "../src/ast/lex.re" +#line 372 "../src/ast/lex.re" name: tok = cur; -#line 2111 "src/ast/lex.cc" +#line 2025 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2147,29 +2061,29 @@ name: if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= '^') { - if (yych <= '@') goto yy341; - if (yych <= 'Z') goto yy343; + if (yych <= '@') goto yy330; + if (yych <= 'Z') goto yy332; } else { - if (yych == '`') goto yy341; - if (yych <= 'z') goto yy343; + if (yych == '`') goto yy330; + if (yych <= 'z') goto yy332; } -yy341: +yy330: ++YYCURSOR; -#line 384 "../src/ast/lex.re" +#line 377 "../src/ast/lex.re" { fatal_l(get_cline(), "syntax error in condition goto"); } -#line 2161 "src/ast/lex.cc" -yy343: +#line 2075 "src/ast/lex.cc" +yy332: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy343; + goto yy332; } -#line 383 "../src/ast/lex.re" +#line 376 "../src/ast/lex.re" { yylval.str = new std::string (tok, tok_len ()); return; } -#line 2171 "src/ast/lex.cc" +#line 2085 "src/ast/lex.cc" } -#line 385 "../src/ast/lex.re" +#line 378 "../src/ast/lex.re" } @@ -2179,98 +2093,98 @@ void Scanner::lex_code_indented() tok = cur; code: -#line 2183 "src/ast/lex.cc" +#line 2097 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\f') { - if (yych <= 0x00) goto yy348; - if (yych == '\n') goto yy352; - goto yy350; + if (yych <= 0x00) goto yy337; + if (yych == '\n') goto yy341; + goto yy339; } else { - if (yych <= '\r') goto yy354; - if (yych == '"') goto yy355; - goto yy350; + if (yych <= '\r') goto yy343; + if (yych == '"') goto yy344; + goto yy339; } } else { if (yych <= 'z') { - if (yych <= '\'') goto yy355; - if (yych == '/') goto yy357; - goto yy350; + if (yych <= '\'') goto yy344; + if (yych == '/') goto yy346; + goto yy339; } else { - if (yych == '|') goto yy350; - if (yych <= '}') goto yy358; - goto yy350; + if (yych == '|') goto yy339; + if (yych <= '}') goto yy347; + goto yy339; } } -yy348: +yy337: ++YYCURSOR; -#line 402 "../src/ast/lex.re" +#line 395 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 2213 "src/ast/lex.cc" -yy350: +#line 2127 "src/ast/lex.cc" +yy339: ++YYCURSOR; -yy351: -#line 407 "../src/ast/lex.re" +yy340: +#line 400 "../src/ast/lex.re" { goto code; } -#line 2219 "src/ast/lex.cc" -yy352: +#line 2133 "src/ast/lex.cc" +yy341: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '\f') { - if (yych <= 0x08) goto yy353; - if (yych <= '\n') goto yy360; + if (yych <= 0x08) goto yy342; + if (yych <= '\n') goto yy349; } else { - if (yych <= '\r') goto yy360; - if (yych == ' ') goto yy360; + if (yych <= '\r') goto yy349; + if (yych == ' ') goto yy349; } -yy353: -#line 395 "../src/ast/lex.re" +yy342: +#line 388 "../src/ast/lex.re" { while (isspace(tok[0])) ++tok; while (cur > tok && isspace(cur[-1])) --cur; yylval.code = new Code(get_fname (), line, tok, tok_len ()); return; } -#line 2237 "src/ast/lex.cc" -yy354: +#line 2151 "src/ast/lex.cc" +yy343: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy352; - goto yy351; -yy355: + if (yych == '\n') goto yy341; + goto yy340; +yy344: ++YYCURSOR; -#line 406 "../src/ast/lex.re" +#line 399 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 2246 "src/ast/lex.cc" -yy357: +#line 2160 "src/ast/lex.cc" +yy346: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy362; - if (yych == '/') goto yy364; - goto yy351; -yy358: + if (yych == '*') goto yy351; + if (yych == '/') goto yy353; + goto yy340; +yy347: ++YYCURSOR; -#line 403 "../src/ast/lex.re" +#line 396 "../src/ast/lex.re" { fatal_l(get_cline(), "Curly braces are not allowed after ':='"); } -#line 2256 "src/ast/lex.cc" -yy360: +#line 2170 "src/ast/lex.cc" +yy349: ++YYCURSOR; YYCURSOR -= 1; -#line 394 "../src/ast/lex.re" +#line 387 "../src/ast/lex.re" { goto code; } -#line 2262 "src/ast/lex.cc" -yy362: +#line 2176 "src/ast/lex.cc" +yy351: ++YYCURSOR; -#line 404 "../src/ast/lex.re" +#line 397 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 2267 "src/ast/lex.cc" -yy364: +#line 2181 "src/ast/lex.cc" +yy353: ++YYCURSOR; -#line 405 "../src/ast/lex.re" +#line 398 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 2272 "src/ast/lex.cc" +#line 2186 "src/ast/lex.cc" } -#line 408 "../src/ast/lex.re" +#line 401 "../src/ast/lex.re" } @@ -2280,7 +2194,7 @@ void Scanner::lex_code_in_braces() uint32_t depth = 1; code: -#line 2284 "src/ast/lex.cc" +#line 2198 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2321,68 +2235,68 @@ code: yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\f') { - if (yych <= 0x00) goto yy368; - if (yych == '\n') goto yy372; - goto yy370; + if (yych <= 0x00) goto yy357; + if (yych == '\n') goto yy361; + goto yy359; } else { - if (yych <= '\r') goto yy374; - if (yych == '"') goto yy375; - goto yy370; + if (yych <= '\r') goto yy363; + if (yych == '"') goto yy364; + goto yy359; } } else { if (yych <= 'z') { - if (yych <= '\'') goto yy375; - if (yych == '/') goto yy377; - goto yy370; + if (yych <= '\'') goto yy364; + if (yych == '/') goto yy366; + goto yy359; } else { - if (yych <= '{') goto yy378; - if (yych == '}') goto yy380; - goto yy370; + if (yych <= '{') goto yy367; + if (yych == '}') goto yy369; + goto yy359; } } -yy368: +yy357: ++YYCURSOR; -#line 428 "../src/ast/lex.re" +#line 421 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 2348 "src/ast/lex.cc" -yy370: +#line 2262 "src/ast/lex.cc" +yy359: ++YYCURSOR; -yy371: -#line 432 "../src/ast/lex.re" +yy360: +#line 425 "../src/ast/lex.re" { goto code; } -#line 2354 "src/ast/lex.cc" -yy372: +#line 2268 "src/ast/lex.cc" +yy361: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy382; + goto yy371; } - if (yych == '#') goto yy385; -yy373: -#line 427 "../src/ast/lex.re" + if (yych == '#') goto yy374; +yy362: +#line 420 "../src/ast/lex.re" { pos = cur; cline++; goto code; } -#line 2364 "src/ast/lex.cc" -yy374: +#line 2278 "src/ast/lex.cc" +yy363: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy372; - goto yy371; -yy375: + if (yych == '\n') goto yy361; + goto yy360; +yy364: ++YYCURSOR; -#line 431 "../src/ast/lex.re" +#line 424 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 2373 "src/ast/lex.cc" -yy377: +#line 2287 "src/ast/lex.cc" +yy366: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy387; - if (yych == '/') goto yy389; - goto yy371; -yy378: + if (yych == '*') goto yy376; + if (yych == '/') goto yy378; + goto yy360; +yy367: ++YYCURSOR; -#line 425 "../src/ast/lex.re" +#line 418 "../src/ast/lex.re" { ++depth; goto code; } -#line 2383 "src/ast/lex.cc" -yy380: +#line 2297 "src/ast/lex.cc" +yy369: ++YYCURSOR; -#line 417 "../src/ast/lex.re" +#line 410 "../src/ast/lex.re" { if (--depth == 0) { yylval.code = new Code(get_fname (), line, tok, tok_len ()); @@ -2390,125 +2304,125 @@ yy380: } goto code; } -#line 2394 "src/ast/lex.cc" -yy382: +#line 2308 "src/ast/lex.cc" +yy371: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 32) { - goto yy382; + goto yy371; } - if (yych == '#') goto yy385; -yy384: + if (yych == '#') goto yy374; +yy373: YYCURSOR = YYMARKER; - goto yy373; -yy385: + goto yy362; +yy374: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy385; - goto yy384; + if (yych == '\t') goto yy374; + goto yy373; } else { - if (yych <= ' ') goto yy385; - if (yych == 'l') goto yy391; - goto yy384; + if (yych <= ' ') goto yy374; + if (yych == 'l') goto yy380; + goto yy373; } -yy387: +yy376: ++YYCURSOR; -#line 429 "../src/ast/lex.re" +#line 422 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 2422 "src/ast/lex.cc" -yy389: +#line 2336 "src/ast/lex.cc" +yy378: ++YYCURSOR; -#line 430 "../src/ast/lex.re" +#line 423 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 2427 "src/ast/lex.cc" -yy391: +#line 2341 "src/ast/lex.cc" +yy380: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy384; + if (yych != 'i') goto yy373; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy384; + if (yych != 'n') goto yy373; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy384; + if (yych != 'e') goto yy373; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy396; - if (yych <= '9') goto yy384; - goto yy396; -yy395: + if (yych <= '0') goto yy385; + if (yych <= '9') goto yy373; + goto yy385; +yy384: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy396: +yy385: if (yych <= 0x1F) { - if (yych == '\t') goto yy395; - goto yy384; + if (yych == '\t') goto yy384; + goto yy373; } else { - if (yych <= ' ') goto yy395; - if (yych <= '0') goto yy384; - if (yych >= ':') goto yy384; + if (yych <= ' ') goto yy384; + if (yych <= '0') goto yy373; + if (yych >= ':') goto yy373; YYCTXMARKER = YYCURSOR; } -yy397: +yy386: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy397; + goto yy386; } if (yych <= '\f') { - if (yych <= 0x08) goto yy384; - if (yych <= '\t') goto yy399; - if (yych <= '\n') goto yy401; - goto yy384; + if (yych <= 0x08) goto yy373; + if (yych <= '\t') goto yy388; + if (yych <= '\n') goto yy390; + goto yy373; } else { - if (yych <= '\r') goto yy403; - if (yych != ' ') goto yy384; + if (yych <= '\r') goto yy392; + if (yych != ' ') goto yy373; } -yy399: +yy388: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy399; - goto yy384; + if (yych == '\t') goto yy388; + goto yy373; } else { - if (yych <= ' ') goto yy399; - if (yych == '"') goto yy404; - goto yy384; + if (yych <= ' ') goto yy388; + if (yych == '"') goto yy393; + goto yy373; } -yy401: +yy390: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 426 "../src/ast/lex.re" +#line 419 "../src/ast/lex.re" { set_sourceline (); goto code; } -#line 2486 "src/ast/lex.cc" -yy403: +#line 2400 "src/ast/lex.cc" +yy392: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy401; - goto yy384; -yy404: + if (yych == '\n') goto yy390; + goto yy373; +yy393: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy404; + goto yy393; } - if (yych <= '\n') goto yy384; - if (yych >= '#') goto yy407; + if (yych <= '\n') goto yy373; + if (yych >= '#') goto yy396; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy401; - if (yych == '\r') goto yy403; - goto yy384; -yy407: + if (yych == '\n') goto yy390; + if (yych == '\r') goto yy392; + goto yy373; +yy396: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy384; - if (yych == '\n') goto yy384; - goto yy404; + if (yych <= 0x00) goto yy373; + if (yych == '\n') goto yy373; + goto yy393; } -#line 433 "../src/ast/lex.re" +#line 426 "../src/ast/lex.re" } @@ -2516,70 +2430,70 @@ void Scanner::lex_string(char delim) { loop: -#line 2520 "src/ast/lex.cc" +#line 2434 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { if (yych <= '\n') { - if (yych <= 0x00) goto yy410; - if (yych <= '\t') goto yy412; - goto yy414; + if (yych <= 0x00) goto yy399; + if (yych <= '\t') goto yy401; + goto yy403; } else { - if (yych == '\r') goto yy416; - goto yy412; + if (yych == '\r') goto yy405; + goto yy401; } } else { if (yych <= '\'') { - if (yych <= '"') goto yy417; - if (yych <= '&') goto yy412; - goto yy417; + if (yych <= '"') goto yy406; + if (yych <= '&') goto yy401; + goto yy406; } else { - if (yych == '\\') goto yy419; - goto yy412; + if (yych == '\\') goto yy408; + goto yy401; } } -yy410: +yy399: ++YYCURSOR; -#line 443 "../src/ast/lex.re" +#line 436 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2548 "src/ast/lex.cc" -yy412: +#line 2462 "src/ast/lex.cc" +yy401: ++YYCURSOR; -yy413: -#line 444 "../src/ast/lex.re" +yy402: +#line 437 "../src/ast/lex.re" { goto loop; } -#line 2554 "src/ast/lex.cc" -yy414: +#line 2468 "src/ast/lex.cc" +yy403: ++YYCURSOR; -#line 442 "../src/ast/lex.re" +#line 435 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 2559 "src/ast/lex.cc" -yy416: +#line 2473 "src/ast/lex.cc" +yy405: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy414; - goto yy413; -yy417: + if (yych == '\n') goto yy403; + goto yy402; +yy406: ++YYCURSOR; -#line 440 "../src/ast/lex.re" +#line 433 "../src/ast/lex.re" { if (cur[-1] == delim) return; else goto loop; } -#line 2568 "src/ast/lex.cc" -yy419: +#line 2482 "src/ast/lex.cc" +yy408: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '&') { - if (yych != '"') goto yy413; + if (yych != '"') goto yy402; } else { - if (yych <= '\'') goto yy420; - if (yych != '\\') goto yy413; + if (yych <= '\'') goto yy409; + if (yych != '\\') goto yy402; } -yy420: +yy409: ++YYCURSOR; -#line 441 "../src/ast/lex.re" +#line 434 "../src/ast/lex.re" { goto loop; } -#line 2581 "src/ast/lex.cc" +#line 2495 "src/ast/lex.cc" } -#line 445 "../src/ast/lex.re" +#line 438 "../src/ast/lex.re" } @@ -2587,49 +2501,49 @@ void Scanner::lex_c_comment() { loop: -#line 2591 "src/ast/lex.cc" +#line 2505 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy424; - if (yych == '\n') goto yy428; - goto yy426; + if (yych <= 0x00) goto yy413; + if (yych == '\n') goto yy417; + goto yy415; } else { - if (yych <= '\r') goto yy430; - if (yych == '*') goto yy431; - goto yy426; + if (yych <= '\r') goto yy419; + if (yych == '*') goto yy420; + goto yy415; } -yy424: +yy413: ++YYCURSOR; -#line 454 "../src/ast/lex.re" +#line 447 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2609 "src/ast/lex.cc" -yy426: +#line 2523 "src/ast/lex.cc" +yy415: ++YYCURSOR; -yy427: -#line 455 "../src/ast/lex.re" +yy416: +#line 448 "../src/ast/lex.re" { goto loop; } -#line 2615 "src/ast/lex.cc" -yy428: +#line 2529 "src/ast/lex.cc" +yy417: ++YYCURSOR; -#line 453 "../src/ast/lex.re" +#line 446 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 2620 "src/ast/lex.cc" -yy430: +#line 2534 "src/ast/lex.cc" +yy419: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy428; - goto yy427; -yy431: + if (yych == '\n') goto yy417; + goto yy416; +yy420: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '/') goto yy427; + if (yych != '/') goto yy416; ++YYCURSOR; -#line 452 "../src/ast/lex.re" +#line 445 "../src/ast/lex.re" { return; } -#line 2631 "src/ast/lex.cc" +#line 2545 "src/ast/lex.cc" } -#line 456 "../src/ast/lex.re" +#line 449 "../src/ast/lex.re" } @@ -2637,41 +2551,41 @@ void Scanner::lex_cpp_comment() { loop: -#line 2641 "src/ast/lex.cc" +#line 2555 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\n') { - if (yych <= 0x00) goto yy436; - if (yych <= '\t') goto yy438; - goto yy440; + if (yych <= 0x00) goto yy425; + if (yych <= '\t') goto yy427; + goto yy429; } else { - if (yych == '\r') goto yy442; - goto yy438; + if (yych == '\r') goto yy431; + goto yy427; } -yy436: +yy425: ++YYCURSOR; -#line 464 "../src/ast/lex.re" +#line 457 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2658 "src/ast/lex.cc" -yy438: +#line 2572 "src/ast/lex.cc" +yy427: ++YYCURSOR; -yy439: -#line 465 "../src/ast/lex.re" +yy428: +#line 458 "../src/ast/lex.re" { goto loop; } -#line 2664 "src/ast/lex.cc" -yy440: +#line 2578 "src/ast/lex.cc" +yy429: ++YYCURSOR; -#line 463 "../src/ast/lex.re" +#line 456 "../src/ast/lex.re" { pos = cur; ++cline; return; } -#line 2669 "src/ast/lex.cc" -yy442: +#line 2583 "src/ast/lex.cc" +yy431: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy440; - goto yy439; + if (yych == '\n') goto yy429; + goto yy428; } -#line 466 "../src/ast/lex.re" +#line 459 "../src/ast/lex.re" } @@ -2683,44 +2597,44 @@ fst: tok = cur; c = get_column(); -#line 2687 "src/ast/lex.cc" +#line 2601 "src/ast/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == ']') goto yy446; -#line 478 "../src/ast/lex.re" + if (yych == ']') goto yy435; +#line 471 "../src/ast/lex.re" { l = lex_cls_chr(); goto snd; } -#line 2695 "src/ast/lex.cc" -yy446: +#line 2609 "src/ast/lex.cc" +yy435: ++YYCURSOR; -#line 477 "../src/ast/lex.re" +#line 470 "../src/ast/lex.re" { return ast_cls(cline, c0, cls, neg); } -#line 2700 "src/ast/lex.cc" +#line 2614 "src/ast/lex.cc" } -#line 479 "../src/ast/lex.re" +#line 472 "../src/ast/lex.re" snd: -#line 2706 "src/ast/lex.cc" +#line 2620 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*(YYMARKER = YYCURSOR); - if (yych == '-') goto yy451; -yy450: -#line 482 "../src/ast/lex.re" + if (yych == '-') goto yy440; +yy439: +#line 475 "../src/ast/lex.re" { u = l; goto add; } -#line 2715 "src/ast/lex.cc" -yy451: +#line 2629 "src/ast/lex.cc" +yy440: yych = (YYCTYPE)*++YYCURSOR; - if (yych != ']') goto yy453; + if (yych != ']') goto yy442; YYCURSOR = YYMARKER; - goto yy450; -yy453: + goto yy439; +yy442: ++YYCURSOR; YYCURSOR -= 1; -#line 483 "../src/ast/lex.re" +#line 476 "../src/ast/lex.re" { u = lex_cls_chr(); if (l > u) { @@ -2729,9 +2643,9 @@ yy453: } goto add; } -#line 2733 "src/ast/lex.cc" +#line 2647 "src/ast/lex.cc" } -#line 491 "../src/ast/lex.re" +#line 484 "../src/ast/lex.re" add: cls->push_back(ASTRange(l, u, c)); @@ -2743,319 +2657,319 @@ uint32_t Scanner::lex_cls_chr() tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 2747 "src/ast/lex.cc" +#line 2661 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy457; - if (yych == '\n') goto yy461; - goto yy459; + if (yych <= 0x00) goto yy446; + if (yych == '\n') goto yy450; + goto yy448; } else { - if (yych <= '\r') goto yy463; - if (yych == '\\') goto yy464; - goto yy459; + if (yych <= '\r') goto yy452; + if (yych == '\\') goto yy453; + goto yy448; } -yy457: +yy446: ++YYCURSOR; -#line 503 "../src/ast/lex.re" +#line 496 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 2766 "src/ast/lex.cc" -yy459: +#line 2680 "src/ast/lex.cc" +yy448: ++YYCURSOR; -yy460: -#line 509 "../src/ast/lex.re" +yy449: +#line 502 "../src/ast/lex.re" { return static_cast(tok[0]); } -#line 2772 "src/ast/lex.cc" -yy461: +#line 2686 "src/ast/lex.cc" +yy450: ++YYCURSOR; -#line 504 "../src/ast/lex.re" +#line 497 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character class"); } -#line 2777 "src/ast/lex.cc" -yy463: +#line 2691 "src/ast/lex.cc" +yy452: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy461; - goto yy460; -yy464: + if (yych == '\n') goto yy450; + goto yy449; +yy453: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '\\') { if (yych <= '/') { if (yych <= '\f') { - if (yych <= 0x00) goto yy465; - if (yych == '\n') goto yy461; - goto yy466; + if (yych <= 0x00) goto yy454; + if (yych == '\n') goto yy450; + goto yy455; } else { - if (yych <= '\r') goto yy468; - if (yych == '-') goto yy469; - goto yy466; + if (yych <= '\r') goto yy457; + if (yych == '-') goto yy458; + goto yy455; } } else { if (yych <= 'U') { - if (yych <= '3') goto yy471; - if (yych <= '7') goto yy473; - if (yych <= 'T') goto yy466; - goto yy474; + if (yych <= '3') goto yy460; + if (yych <= '7') goto yy462; + if (yych <= 'T') goto yy455; + goto yy463; } else { - if (yych == 'X') goto yy476; - if (yych <= '[') goto yy466; - goto yy477; + if (yych == 'X') goto yy465; + if (yych <= '[') goto yy455; + goto yy466; } } } else { if (yych <= 'n') { if (yych <= 'b') { - if (yych <= ']') goto yy479; - if (yych <= '`') goto yy466; - if (yych <= 'a') goto yy481; - goto yy483; + if (yych <= ']') goto yy468; + if (yych <= '`') goto yy455; + if (yych <= 'a') goto yy470; + goto yy472; } else { - if (yych == 'f') goto yy485; - if (yych <= 'm') goto yy466; - goto yy487; + if (yych == 'f') goto yy474; + if (yych <= 'm') goto yy455; + goto yy476; } } else { if (yych <= 't') { - if (yych == 'r') goto yy489; - if (yych <= 's') goto yy466; - goto yy491; + if (yych == 'r') goto yy478; + if (yych <= 's') goto yy455; + goto yy480; } else { if (yych <= 'v') { - if (yych <= 'u') goto yy476; - goto yy493; + if (yych <= 'u') goto yy465; + goto yy482; } else { - if (yych == 'x') goto yy495; - goto yy466; + if (yych == 'x') goto yy484; + goto yy455; } } } } -yy465: -#line 507 "../src/ast/lex.re" +yy454: +#line 500 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 2838 "src/ast/lex.cc" -yy466: +#line 2752 "src/ast/lex.cc" +yy455: ++YYCURSOR; -yy467: -#line 522 "../src/ast/lex.re" +yy456: +#line 515 "../src/ast/lex.re" { warn.useless_escape(cline, get_column(), tok[1]); return static_cast(tok[1]); } -#line 2847 "src/ast/lex.cc" -yy468: +#line 2761 "src/ast/lex.cc" +yy457: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy461; - goto yy467; -yy469: + if (yych == '\n') goto yy450; + goto yy456; +yy458: ++YYCURSOR; -#line 520 "../src/ast/lex.re" +#line 513 "../src/ast/lex.re" { return static_cast('-'); } -#line 2856 "src/ast/lex.cc" -yy471: +#line 2770 "src/ast/lex.cc" +yy460: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy472; - if (yych <= '7') goto yy496; -yy472: -#line 506 "../src/ast/lex.re" + if (yych <= '/') goto yy461; + if (yych <= '7') goto yy485; +yy461: +#line 499 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 2865 "src/ast/lex.cc" -yy473: +#line 2779 "src/ast/lex.cc" +yy462: ++YYCURSOR; - goto yy472; -yy474: + goto yy461; +yy463: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy475; - if (yych <= '9') goto yy498; + if (yych <= '/') goto yy464; + if (yych <= '9') goto yy487; } else { - if (yych <= 'F') goto yy498; - if (yych <= '`') goto yy475; - if (yych <= 'f') goto yy498; + if (yych <= 'F') goto yy487; + if (yych <= '`') goto yy464; + if (yych <= 'f') goto yy487; } -yy475: -#line 505 "../src/ast/lex.re" +yy464: +#line 498 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 2883 "src/ast/lex.cc" -yy476: +#line 2797 "src/ast/lex.cc" +yy465: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy475; - if (yych <= '9') goto yy499; - goto yy475; + if (yych <= '/') goto yy464; + if (yych <= '9') goto yy488; + goto yy464; } else { - if (yych <= 'F') goto yy499; - if (yych <= '`') goto yy475; - if (yych <= 'f') goto yy499; - goto yy475; + if (yych <= 'F') goto yy488; + if (yych <= '`') goto yy464; + if (yych <= 'f') goto yy488; + goto yy464; } -yy477: +yy466: ++YYCURSOR; -#line 519 "../src/ast/lex.re" +#line 512 "../src/ast/lex.re" { return static_cast('\\'); } -#line 2901 "src/ast/lex.cc" -yy479: +#line 2815 "src/ast/lex.cc" +yy468: ++YYCURSOR; -#line 521 "../src/ast/lex.re" +#line 514 "../src/ast/lex.re" { return static_cast(']'); } -#line 2906 "src/ast/lex.cc" -yy481: +#line 2820 "src/ast/lex.cc" +yy470: ++YYCURSOR; -#line 512 "../src/ast/lex.re" +#line 505 "../src/ast/lex.re" { return static_cast('\a'); } -#line 2911 "src/ast/lex.cc" -yy483: +#line 2825 "src/ast/lex.cc" +yy472: ++YYCURSOR; -#line 513 "../src/ast/lex.re" +#line 506 "../src/ast/lex.re" { return static_cast('\b'); } -#line 2916 "src/ast/lex.cc" -yy485: +#line 2830 "src/ast/lex.cc" +yy474: ++YYCURSOR; -#line 514 "../src/ast/lex.re" +#line 507 "../src/ast/lex.re" { return static_cast('\f'); } -#line 2921 "src/ast/lex.cc" -yy487: +#line 2835 "src/ast/lex.cc" +yy476: ++YYCURSOR; -#line 515 "../src/ast/lex.re" +#line 508 "../src/ast/lex.re" { return static_cast('\n'); } -#line 2926 "src/ast/lex.cc" -yy489: +#line 2840 "src/ast/lex.cc" +yy478: ++YYCURSOR; -#line 516 "../src/ast/lex.re" +#line 509 "../src/ast/lex.re" { return static_cast('\r'); } -#line 2931 "src/ast/lex.cc" -yy491: +#line 2845 "src/ast/lex.cc" +yy480: ++YYCURSOR; -#line 517 "../src/ast/lex.re" +#line 510 "../src/ast/lex.re" { return static_cast('\t'); } -#line 2936 "src/ast/lex.cc" -yy493: +#line 2850 "src/ast/lex.cc" +yy482: ++YYCURSOR; -#line 518 "../src/ast/lex.re" +#line 511 "../src/ast/lex.re" { return static_cast('\v'); } -#line 2941 "src/ast/lex.cc" -yy495: +#line 2855 "src/ast/lex.cc" +yy484: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy475; - if (yych <= '9') goto yy500; - goto yy475; + if (yych <= '/') goto yy464; + if (yych <= '9') goto yy489; + goto yy464; } else { - if (yych <= 'F') goto yy500; - if (yych <= '`') goto yy475; - if (yych <= 'f') goto yy500; - goto yy475; + if (yych <= 'F') goto yy489; + if (yych <= '`') goto yy464; + if (yych <= 'f') goto yy489; + goto yy464; } -yy496: +yy485: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy497; - if (yych <= '7') goto yy501; -yy497: + if (yych <= '/') goto yy486; + if (yych <= '7') goto yy490; +yy486: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy472; + goto yy461; } else { - goto yy475; + goto yy464; } -yy498: +yy487: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy497; - if (yych <= '9') goto yy503; - goto yy497; + if (yych <= '/') goto yy486; + if (yych <= '9') goto yy492; + goto yy486; } else { - if (yych <= 'F') goto yy503; - if (yych <= '`') goto yy497; - if (yych <= 'f') goto yy503; - goto yy497; + if (yych <= 'F') goto yy492; + if (yych <= '`') goto yy486; + if (yych <= 'f') goto yy492; + goto yy486; } -yy499: +yy488: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy497; - if (yych <= '9') goto yy504; - goto yy497; + if (yych <= '/') goto yy486; + if (yych <= '9') goto yy493; + goto yy486; } else { - if (yych <= 'F') goto yy504; - if (yych <= '`') goto yy497; - if (yych <= 'f') goto yy504; - goto yy497; + if (yych <= 'F') goto yy493; + if (yych <= '`') goto yy486; + if (yych <= 'f') goto yy493; + goto yy486; } -yy500: +yy489: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy497; - if (yych <= '9') goto yy505; - goto yy497; + if (yych <= '/') goto yy486; + if (yych <= '9') goto yy494; + goto yy486; } else { - if (yych <= 'F') goto yy505; - if (yych <= '`') goto yy497; - if (yych <= 'f') goto yy505; - goto yy497; + if (yych <= 'F') goto yy494; + if (yych <= '`') goto yy486; + if (yych <= 'f') goto yy494; + goto yy486; } -yy501: +yy490: ++YYCURSOR; -#line 511 "../src/ast/lex.re" +#line 504 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 3006 "src/ast/lex.cc" -yy503: +#line 2920 "src/ast/lex.cc" +yy492: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy497; - if (yych <= '9') goto yy507; - goto yy497; + if (yych <= '/') goto yy486; + if (yych <= '9') goto yy496; + goto yy486; } else { - if (yych <= 'F') goto yy507; - if (yych <= '`') goto yy497; - if (yych <= 'f') goto yy507; - goto yy497; + if (yych <= 'F') goto yy496; + if (yych <= '`') goto yy486; + if (yych <= 'f') goto yy496; + goto yy486; } -yy504: +yy493: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy497; - if (yych <= '9') goto yy500; - goto yy497; + if (yych <= '/') goto yy486; + if (yych <= '9') goto yy489; + goto yy486; } else { - if (yych <= 'F') goto yy500; - if (yych <= '`') goto yy497; - if (yych <= 'f') goto yy500; - goto yy497; + if (yych <= 'F') goto yy489; + if (yych <= '`') goto yy486; + if (yych <= 'f') goto yy489; + goto yy486; } -yy505: +yy494: ++YYCURSOR; -#line 510 "../src/ast/lex.re" +#line 503 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 3035 "src/ast/lex.cc" -yy507: +#line 2949 "src/ast/lex.cc" +yy496: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy497; - if (yych >= ':') goto yy497; + if (yych <= '/') goto yy486; + if (yych >= ':') goto yy486; } else { - if (yych <= 'F') goto yy508; - if (yych <= '`') goto yy497; - if (yych >= 'g') goto yy497; + if (yych <= 'F') goto yy497; + if (yych <= '`') goto yy486; + if (yych >= 'g') goto yy486; } -yy508: +yy497: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy497; - if (yych <= '9') goto yy499; - goto yy497; + if (yych <= '/') goto yy486; + if (yych <= '9') goto yy488; + goto yy486; } else { - if (yych <= 'F') goto yy499; - if (yych <= '`') goto yy497; - if (yych <= 'f') goto yy499; - goto yy497; + if (yych <= 'F') goto yy488; + if (yych <= '`') goto yy486; + if (yych <= 'f') goto yy488; + goto yy486; } } -#line 526 "../src/ast/lex.re" +#line 519 "../src/ast/lex.re" } @@ -3065,309 +2979,309 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 3069 "src/ast/lex.cc" +#line 2983 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy511; - if (yych == '\n') goto yy515; - goto yy513; + if (yych <= 0x00) goto yy500; + if (yych == '\n') goto yy504; + goto yy502; } else { - if (yych <= '\r') goto yy517; - if (yych == '\\') goto yy518; - goto yy513; + if (yych <= '\r') goto yy506; + if (yych == '\\') goto yy507; + goto yy502; } -yy511: +yy500: ++YYCURSOR; -#line 536 "../src/ast/lex.re" +#line 529 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 3088 "src/ast/lex.cc" -yy513: +#line 3002 "src/ast/lex.cc" +yy502: ++YYCURSOR; -yy514: -#line 542 "../src/ast/lex.re" +yy503: +#line 535 "../src/ast/lex.re" { end = tok[0] == quote; return static_cast(tok[0]); } -#line 3097 "src/ast/lex.cc" -yy515: +#line 3011 "src/ast/lex.cc" +yy504: ++YYCURSOR; -#line 537 "../src/ast/lex.re" +#line 530 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character string"); } -#line 3102 "src/ast/lex.cc" -yy517: +#line 3016 "src/ast/lex.cc" +yy506: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy515; - goto yy514; -yy518: + if (yych == '\n') goto yy504; + goto yy503; +yy507: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '`') { if (yych <= '3') { if (yych <= '\n') { - if (yych <= 0x00) goto yy519; - if (yych <= '\t') goto yy520; - goto yy515; + if (yych <= 0x00) goto yy508; + if (yych <= '\t') goto yy509; + goto yy504; } else { - if (yych == '\r') goto yy522; - if (yych <= '/') goto yy520; - goto yy523; + if (yych == '\r') goto yy511; + if (yych <= '/') goto yy509; + goto yy512; } } else { if (yych <= 'W') { - if (yych <= '7') goto yy525; - if (yych == 'U') goto yy526; - goto yy520; + if (yych <= '7') goto yy514; + if (yych == 'U') goto yy515; + goto yy509; } else { - if (yych <= 'X') goto yy528; - if (yych == '\\') goto yy529; - goto yy520; + if (yych <= 'X') goto yy517; + if (yych == '\\') goto yy518; + goto yy509; } } } else { if (yych <= 'q') { if (yych <= 'e') { - if (yych <= 'a') goto yy531; - if (yych <= 'b') goto yy533; - goto yy520; + if (yych <= 'a') goto yy520; + if (yych <= 'b') goto yy522; + goto yy509; } else { - if (yych <= 'f') goto yy535; - if (yych == 'n') goto yy537; - goto yy520; + if (yych <= 'f') goto yy524; + if (yych == 'n') goto yy526; + goto yy509; } } else { if (yych <= 'u') { - if (yych <= 'r') goto yy539; - if (yych <= 's') goto yy520; - if (yych <= 't') goto yy541; - goto yy528; + if (yych <= 'r') goto yy528; + if (yych <= 's') goto yy509; + if (yych <= 't') goto yy530; + goto yy517; } else { - if (yych <= 'v') goto yy543; - if (yych == 'x') goto yy545; - goto yy520; + if (yych <= 'v') goto yy532; + if (yych == 'x') goto yy534; + goto yy509; } } } -yy519: -#line 540 "../src/ast/lex.re" +yy508: +#line 533 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 3158 "src/ast/lex.cc" -yy520: +#line 3072 "src/ast/lex.cc" +yy509: ++YYCURSOR; -yy521: -#line 556 "../src/ast/lex.re" +yy510: +#line 549 "../src/ast/lex.re" { if (tok[1] != quote) { warn.useless_escape(cline, get_column(), tok[1]); } return static_cast(tok[1]); } -#line 3169 "src/ast/lex.cc" -yy522: +#line 3083 "src/ast/lex.cc" +yy511: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy515; - goto yy521; -yy523: + if (yych == '\n') goto yy504; + goto yy510; +yy512: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy524; - if (yych <= '7') goto yy546; -yy524: -#line 539 "../src/ast/lex.re" + if (yych <= '/') goto yy513; + if (yych <= '7') goto yy535; +yy513: +#line 532 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 3182 "src/ast/lex.cc" -yy525: +#line 3096 "src/ast/lex.cc" +yy514: ++YYCURSOR; - goto yy524; -yy526: + goto yy513; +yy515: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy527; - if (yych <= '9') goto yy548; + if (yych <= '/') goto yy516; + if (yych <= '9') goto yy537; } else { - if (yych <= 'F') goto yy548; - if (yych <= '`') goto yy527; - if (yych <= 'f') goto yy548; + if (yych <= 'F') goto yy537; + if (yych <= '`') goto yy516; + if (yych <= 'f') goto yy537; } -yy527: -#line 538 "../src/ast/lex.re" +yy516: +#line 531 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 3200 "src/ast/lex.cc" -yy528: +#line 3114 "src/ast/lex.cc" +yy517: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy527; - if (yych <= '9') goto yy549; - goto yy527; + if (yych <= '/') goto yy516; + if (yych <= '9') goto yy538; + goto yy516; } else { - if (yych <= 'F') goto yy549; - if (yych <= '`') goto yy527; - if (yych <= 'f') goto yy549; - goto yy527; + if (yych <= 'F') goto yy538; + if (yych <= '`') goto yy516; + if (yych <= 'f') goto yy538; + goto yy516; } -yy529: +yy518: ++YYCURSOR; -#line 555 "../src/ast/lex.re" +#line 548 "../src/ast/lex.re" { return static_cast('\\'); } -#line 3218 "src/ast/lex.cc" -yy531: +#line 3132 "src/ast/lex.cc" +yy520: ++YYCURSOR; -#line 548 "../src/ast/lex.re" +#line 541 "../src/ast/lex.re" { return static_cast('\a'); } -#line 3223 "src/ast/lex.cc" -yy533: +#line 3137 "src/ast/lex.cc" +yy522: ++YYCURSOR; -#line 549 "../src/ast/lex.re" +#line 542 "../src/ast/lex.re" { return static_cast('\b'); } -#line 3228 "src/ast/lex.cc" -yy535: +#line 3142 "src/ast/lex.cc" +yy524: ++YYCURSOR; -#line 550 "../src/ast/lex.re" +#line 543 "../src/ast/lex.re" { return static_cast('\f'); } -#line 3233 "src/ast/lex.cc" -yy537: +#line 3147 "src/ast/lex.cc" +yy526: ++YYCURSOR; -#line 551 "../src/ast/lex.re" +#line 544 "../src/ast/lex.re" { return static_cast('\n'); } -#line 3238 "src/ast/lex.cc" -yy539: +#line 3152 "src/ast/lex.cc" +yy528: ++YYCURSOR; -#line 552 "../src/ast/lex.re" +#line 545 "../src/ast/lex.re" { return static_cast('\r'); } -#line 3243 "src/ast/lex.cc" -yy541: +#line 3157 "src/ast/lex.cc" +yy530: ++YYCURSOR; -#line 553 "../src/ast/lex.re" +#line 546 "../src/ast/lex.re" { return static_cast('\t'); } -#line 3248 "src/ast/lex.cc" -yy543: +#line 3162 "src/ast/lex.cc" +yy532: ++YYCURSOR; -#line 554 "../src/ast/lex.re" +#line 547 "../src/ast/lex.re" { return static_cast('\v'); } -#line 3253 "src/ast/lex.cc" -yy545: +#line 3167 "src/ast/lex.cc" +yy534: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy527; - if (yych <= '9') goto yy550; - goto yy527; + if (yych <= '/') goto yy516; + if (yych <= '9') goto yy539; + goto yy516; } else { - if (yych <= 'F') goto yy550; - if (yych <= '`') goto yy527; - if (yych <= 'f') goto yy550; - goto yy527; + if (yych <= 'F') goto yy539; + if (yych <= '`') goto yy516; + if (yych <= 'f') goto yy539; + goto yy516; } -yy546: +yy535: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy547; - if (yych <= '7') goto yy551; -yy547: + if (yych <= '/') goto yy536; + if (yych <= '7') goto yy540; +yy536: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy524; + goto yy513; } else { - goto yy527; + goto yy516; } -yy548: +yy537: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy547; - if (yych <= '9') goto yy553; - goto yy547; + if (yych <= '/') goto yy536; + if (yych <= '9') goto yy542; + goto yy536; } else { - if (yych <= 'F') goto yy553; - if (yych <= '`') goto yy547; - if (yych <= 'f') goto yy553; - goto yy547; + if (yych <= 'F') goto yy542; + if (yych <= '`') goto yy536; + if (yych <= 'f') goto yy542; + goto yy536; } -yy549: +yy538: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy547; - if (yych <= '9') goto yy554; - goto yy547; + if (yych <= '/') goto yy536; + if (yych <= '9') goto yy543; + goto yy536; } else { - if (yych <= 'F') goto yy554; - if (yych <= '`') goto yy547; - if (yych <= 'f') goto yy554; - goto yy547; + if (yych <= 'F') goto yy543; + if (yych <= '`') goto yy536; + if (yych <= 'f') goto yy543; + goto yy536; } -yy550: +yy539: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy547; - if (yych <= '9') goto yy555; - goto yy547; + if (yych <= '/') goto yy536; + if (yych <= '9') goto yy544; + goto yy536; } else { - if (yych <= 'F') goto yy555; - if (yych <= '`') goto yy547; - if (yych <= 'f') goto yy555; - goto yy547; + if (yych <= 'F') goto yy544; + if (yych <= '`') goto yy536; + if (yych <= 'f') goto yy544; + goto yy536; } -yy551: +yy540: ++YYCURSOR; -#line 547 "../src/ast/lex.re" +#line 540 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 3318 "src/ast/lex.cc" -yy553: +#line 3232 "src/ast/lex.cc" +yy542: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy547; - if (yych <= '9') goto yy557; - goto yy547; + if (yych <= '/') goto yy536; + if (yych <= '9') goto yy546; + goto yy536; } else { - if (yych <= 'F') goto yy557; - if (yych <= '`') goto yy547; - if (yych <= 'f') goto yy557; - goto yy547; + if (yych <= 'F') goto yy546; + if (yych <= '`') goto yy536; + if (yych <= 'f') goto yy546; + goto yy536; } -yy554: +yy543: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy547; - if (yych <= '9') goto yy550; - goto yy547; + if (yych <= '/') goto yy536; + if (yych <= '9') goto yy539; + goto yy536; } else { - if (yych <= 'F') goto yy550; - if (yych <= '`') goto yy547; - if (yych <= 'f') goto yy550; - goto yy547; + if (yych <= 'F') goto yy539; + if (yych <= '`') goto yy536; + if (yych <= 'f') goto yy539; + goto yy536; } -yy555: +yy544: ++YYCURSOR; -#line 546 "../src/ast/lex.re" +#line 539 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 3347 "src/ast/lex.cc" -yy557: +#line 3261 "src/ast/lex.cc" +yy546: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy547; - if (yych >= ':') goto yy547; + if (yych <= '/') goto yy536; + if (yych >= ':') goto yy536; } else { - if (yych <= 'F') goto yy558; - if (yych <= '`') goto yy547; - if (yych >= 'g') goto yy547; + if (yych <= 'F') goto yy547; + if (yych <= '`') goto yy536; + if (yych >= 'g') goto yy536; } -yy558: +yy547: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy547; - if (yych <= '9') goto yy549; - goto yy547; + if (yych <= '/') goto yy536; + if (yych <= '9') goto yy538; + goto yy536; } else { - if (yych <= 'F') goto yy549; - if (yych <= '`') goto yy547; - if (yych <= 'f') goto yy549; - goto yy547; + if (yych <= 'F') goto yy538; + if (yych <= '`') goto yy536; + if (yych <= 'f') goto yy538; + goto yy536; } } -#line 562 "../src/ast/lex.re" +#line 555 "../src/ast/lex.re" } @@ -3387,7 +3301,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 3391 "src/ast/lex.cc" +#line 3305 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -3428,100 +3342,100 @@ sourceline: yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych >= 0x01) goto yy563; + if (yych >= 0x01) goto yy552; } else { - if (yych <= '\n') goto yy565; - if (yych <= '\f') goto yy563; - goto yy567; + if (yych <= '\n') goto yy554; + if (yych <= '\f') goto yy552; + goto yy556; } } else { if (yych <= '"') { - if (yych <= '!') goto yy563; - goto yy568; + if (yych <= '!') goto yy552; + goto yy557; } else { - if (yych <= '0') goto yy563; - if (yych <= '9') goto yy569; - goto yy563; + if (yych <= '0') goto yy552; + if (yych <= '9') goto yy558; + goto yy552; } } ++YYCURSOR; -#line 599 "../src/ast/lex.re" +#line 592 "../src/ast/lex.re" { --cur; tok = cur; return; } -#line 3455 "src/ast/lex.cc" -yy563: +#line 3369 "src/ast/lex.cc" +yy552: ++YYCURSOR; -yy564: -#line 605 "../src/ast/lex.re" +yy553: +#line 598 "../src/ast/lex.re" { goto sourceline; } -#line 3461 "src/ast/lex.cc" -yy565: +#line 3375 "src/ast/lex.cc" +yy554: ++YYCURSOR; -#line 594 "../src/ast/lex.re" +#line 587 "../src/ast/lex.re" { tok = cur; return; } -#line 3469 "src/ast/lex.cc" -yy567: +#line 3383 "src/ast/lex.cc" +yy556: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy565; - goto yy564; -yy568: + if (yych == '\n') goto yy554; + goto yy553; +yy557: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= 0x00) goto yy564; - if (yych == '\n') goto yy564; - goto yy573; -yy569: + if (yych <= 0x00) goto yy553; + if (yych == '\n') goto yy553; + goto yy562; +yy558: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy569; + goto yy558; } -#line 581 "../src/ast/lex.re" +#line 574 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { fatal_lc(get_cline(), get_column(), "line number overflow"); } goto sourceline; } -#line 3493 "src/ast/lex.cc" -yy572: +#line 3407 "src/ast/lex.cc" +yy561: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy573: +yy562: if (yybm[0+yych] & 128) { - goto yy572; + goto yy561; } - if (yych <= '\n') goto yy574; - if (yych <= '"') goto yy575; - goto yy577; -yy574: + if (yych <= '\n') goto yy563; + if (yych <= '"') goto yy564; + goto yy566; +yy563: YYCURSOR = YYMARKER; - goto yy564; -yy575: + goto yy553; +yy564: ++YYCURSOR; -#line 588 "../src/ast/lex.re" +#line 581 "../src/ast/lex.re" { in.escaped_file_name = std::string (tok + 1, tok_len () - 2); // strip quotes strrreplace (in.escaped_file_name, "\\", "\\\\"); goto sourceline; } -#line 3516 "src/ast/lex.cc" -yy577: +#line 3430 "src/ast/lex.cc" +yy566: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy574; - if (yych == '\n') goto yy574; - goto yy572; + if (yych <= 0x00) goto yy563; + if (yych == '\n') goto yy563; + goto yy561; } -#line 606 "../src/ast/lex.re" +#line 599 "../src/ast/lex.re" } diff --git a/re2c/bootstrap/src/ast/parser.cc b/re2c/bootstrap/src/ast/parser.cc index cfb91d62..30ae61e5 100644 --- a/re2c/bootstrap/src/ast/parser.cc +++ b/re2c/bootstrap/src/ast/parser.cc @@ -478,10 +478,10 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyrline[] = { 0, 72, 72, 74, 75, 76, 77, 81, 88, 94, - 97, 101, 101, 104, 108, 112, 119, 126, 133, 139, - 141, 147, 154, 156, 162, 166, 173, 177, 184, 188, - 195, 196, 202, 207, 208, 212, 213, 214, 218, 219, - 230 + 97, 101, 101, 104, 108, 112, 119, 126, 133, 140, + 142, 148, 155, 157, 163, 167, 174, 178, 185, 189, + 196, 197, 203, 208, 209, 213, 214, 215, 219, 220, + 231 }; #endif @@ -1386,6 +1386,7 @@ yyreduce: { const AST *r = ast_nil(context.input.get_cline(), 0); find(context.specs, "0").rules.push_back(ASTRule(r, (yyvsp[0].code))); + delete (yyvsp[-1].clist); } break; diff --git a/re2c/src/ast/lex.re b/re2c/src/ast/lex.re index 1e06b63c..99c9cc6c 100644 --- a/re2c/src/ast/lex.re +++ b/re2c/src/ast/lex.re @@ -338,30 +338,23 @@ bool Scanner::lex_namedef_context_flex() int Scanner::lex_clist() { int kind = TOKEN_CLIST; - CondList *cl = NULL; + CondList *cl = new CondList; /*!re2c - space* "!" space* { kind = TOKEN_CSETUP; goto fst; } + space* "!" space* { kind = TOKEN_CSETUP; goto cond; } space* ">" { kind = TOKEN_CZERO; goto end; } - space* { goto fst; } + space* { goto cond; } */ -fst: - cl = new CondList; +cond: tok = cur; /*!re2c - "*" space* ">" { cl->insert("*"); goto end; } - name { cl->insert(std::string(tok, tok_len())); goto sep; } - * { goto error; } -*/ -sep: -/*!re2c - space* "," space* { goto next; } - space* ">" { goto end; } + name { cl->insert(std::string(tok, tok_len())); goto next; } + "*" { if (!cl->empty()) goto error; cl->insert("*"); goto next; } * { goto error; } */ next: - tok = cur; /*!re2c - name { cl->insert(std::string(tok, tok_len())); goto sep; } + space* "," space* { goto cond; } + space* ">" { goto end; } * { goto error; } */ end: diff --git a/re2c/src/ast/parser.ypp b/re2c/src/ast/parser.ypp index 87a606f2..287d2d32 100644 --- a/re2c/src/ast/parser.ypp +++ b/re2c/src/ast/parser.ypp @@ -133,6 +133,7 @@ rule | TOKEN_CZERO ccode { const AST *r = ast_nil(context.input.get_cline(), 0); find(context.specs, "0").rules.push_back(ASTRule(r, $2)); + delete $1; }; ccode -- 2.40.0