From 40f22fa9f5c59ac63eddaa98be5db689eea2cb7e Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 5 Nov 2018 23:35:11 +0000 Subject: [PATCH] Adjusting formatting (cosmetic). --- re2c/bootstrap/src/ast/lex.cc | 562 +++++++++++++++++----------------- re2c/src/ast/lex.re | 42 ++- 2 files changed, 297 insertions(+), 307 deletions(-) diff --git a/re2c/bootstrap/src/ast/lex.cc b/re2c/bootstrap/src/ast/lex.cc index b1c4bf11..e2ba927a 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 Wed Oct 31 23:59:37 2018 */ +/* Generated by re2c 1.1.1 on Mon Nov 5 23:34:07 2018 */ #line 1 "../src/ast/lex.re" #include "src/util/c99_stdint.h" #include @@ -32,13 +32,7 @@ extern YYSTYPE yylval; namespace re2c { -// source code is in ASCII: pointers have type 'char *' -// but re2c makes an implicit assumption that YYCTYPE is unsigned -// when it generates comparisons -#line 38 "../src/ast/lex.re" - - -#line 60 "../src/ast/lex.re" +#line 56 "../src/ast/lex.re" Scanner::ParseMode Scanner::echo(OutputFile &out) @@ -53,7 +47,7 @@ echo: ptr = cur; -#line 57 "src/ast/lex.cc" +#line 51 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -111,19 +105,19 @@ echo: } } ++YYCURSOR; -#line 137 "../src/ast/lex.re" +#line 133 "../src/ast/lex.re" { if (cur != eof) goto echo; out.wraw(tok, ptr); return Stop; } -#line 121 "src/ast/lex.cc" +#line 115 "src/ast/lex.cc" yy4: ++YYCURSOR; yy5: -#line 155 "../src/ast/lex.re" +#line 151 "../src/ast/lex.re" { goto echo; } -#line 127 "src/ast/lex.cc" +#line 121 "src/ast/lex.cc" yy6: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -132,13 +126,13 @@ yy6: } if (yych == '#') goto yy14; yy7: -#line 149 "../src/ast/lex.re" +#line 145 "../src/ast/lex.re" { cline++; pos = cur; goto echo; } -#line 142 "src/ast/lex.cc" +#line 136 "src/ast/lex.cc" yy8: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy6; @@ -181,12 +175,12 @@ yy14: } yy16: ++YYCURSOR; -#line 74 "../src/ast/lex.re" +#line 70 "../src/ast/lex.re" { out.wraw(tok, ptr); return Parse; } -#line 190 "src/ast/lex.cc" +#line 184 "src/ast/lex.cc" yy18: yych = (YYCTYPE)*++YYCURSOR; if (yych == '!') goto yy20; @@ -444,13 +438,13 @@ yy71: yy73: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 143 "../src/ast/lex.re" +#line 139 "../src/ast/lex.re" { out.wraw(tok, ptr + 1); set_sourceline(); goto echo; } -#line 454 "src/ast/lex.cc" +#line 448 "src/ast/lex.cc" yy75: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy73; @@ -559,14 +553,14 @@ yy99: goto yy13; yy100: ++YYCURSOR; -#line 95 "../src/ast/lex.re" +#line 91 "../src/ast/lex.re" { out.wraw(tok, ptr); out.wdelay_yymaxfill(); lex_end_of_comment(out); goto echo; } -#line 570 "src/ast/lex.cc" +#line 564 "src/ast/lex.cc" yy102: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'h') goto yy111; @@ -589,12 +583,12 @@ yy106: goto yy13; yy107: ++YYCURSOR; -#line 84 "../src/ast/lex.re" +#line 80 "../src/ast/lex.re" { out.wraw(tok, ptr); return Reuse; } -#line 598 "src/ast/lex.cc" +#line 592 "src/ast/lex.cc" yy109: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy116; @@ -637,33 +631,33 @@ yy118: goto yy13; yy119: ++YYCURSOR; -#line 131 "../src/ast/lex.re" +#line 127 "../src/ast/lex.re" { out.wraw(tok, ptr); lex_tags(out, true); goto echo; } -#line 647 "src/ast/lex.cc" +#line 641 "src/ast/lex.cc" yy121: ++YYCURSOR; -#line 79 "../src/ast/lex.re" +#line 75 "../src/ast/lex.re" { out.wraw(tok, ptr); return Rules; } -#line 655 "src/ast/lex.cc" +#line 649 "src/ast/lex.cc" yy123: ++YYCURSOR; -#line 125 "../src/ast/lex.re" +#line 121 "../src/ast/lex.re" { out.wraw(tok, ptr); lex_tags(out, false); goto echo; } -#line 664 "src/ast/lex.cc" +#line 658 "src/ast/lex.cc" yy125: ++YYCURSOR; -#line 116 "../src/ast/lex.re" +#line 112 "../src/ast/lex.re" { out.wraw(tok, ptr); out.wdelay_line_info_output(); @@ -672,20 +666,20 @@ yy125: lex_end_of_comment(out); goto echo; } -#line 676 "src/ast/lex.cc" +#line 670 "src/ast/lex.cc" yy127: yych = (YYCTYPE)*++YYCURSOR; if (yych == '2') goto yy131; goto yy13; yy128: ++YYCURSOR; -#line 89 "../src/ast/lex.re" +#line 85 "../src/ast/lex.re" { out.wraw(tok, ptr); lex_end_of_comment(out); goto echo; } -#line 689 "src/ast/lex.cc" +#line 683 "src/ast/lex.cc" yy130: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy132; @@ -700,28 +694,28 @@ yy132: goto yy13; yy133: ++YYCURSOR; -#line 109 "../src/ast/lex.re" +#line 105 "../src/ast/lex.re" { out.wraw(tok, ptr); out.wdelay_state_goto(0); lex_end_of_comment(out); goto echo; } -#line 711 "src/ast/lex.cc" +#line 705 "src/ast/lex.cc" yy135: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy13; ++YYCURSOR; -#line 102 "../src/ast/lex.re" +#line 98 "../src/ast/lex.re" { out.wraw(tok, ptr); out.wdelay_yymaxnmatch(); lex_end_of_comment(out); goto echo; } -#line 723 "src/ast/lex.cc" +#line 717 "src/ast/lex.cc" } -#line 156 "../src/ast/lex.re" +#line 152 "../src/ast/lex.re" } @@ -729,7 +723,7 @@ void Scanner::lex_end_of_comment(OutputFile &out) { uint32_t ignored = 0; for (;;) { -#line 733 "src/ast/lex.cc" +#line 727 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -745,20 +739,20 @@ void Scanner::lex_end_of_comment(OutputFile &out) } yy140: ++YYCURSOR; -#line 163 "../src/ast/lex.re" +#line 159 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "expected end of block"); } -#line 751 "src/ast/lex.cc" +#line 745 "src/ast/lex.cc" yy142: ++YYCURSOR; yy143: -#line 165 "../src/ast/lex.re" +#line 161 "../src/ast/lex.re" { continue; } -#line 757 "src/ast/lex.cc" +#line 751 "src/ast/lex.cc" yy144: ++YYCURSOR; -#line 166 "../src/ast/lex.re" +#line 162 "../src/ast/lex.re" { ++ignored; continue; } -#line 762 "src/ast/lex.cc" +#line 756 "src/ast/lex.cc" yy146: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy144; @@ -767,7 +761,7 @@ yy147: yych = (YYCTYPE)*++YYCURSOR; if (yych != '/') goto yy143; ++YYCURSOR; -#line 167 "../src/ast/lex.re" +#line 163 "../src/ast/lex.re" { if (ignored > 0) { cline += ignored; @@ -776,9 +770,9 @@ yy147: tok = pos = cur; return; } -#line 780 "src/ast/lex.cc" +#line 774 "src/ast/lex.cc" } -#line 175 "../src/ast/lex.re" +#line 171 "../src/ast/lex.re" } } @@ -786,7 +780,7 @@ void Scanner::lex_tags(OutputFile &out, bool mtags) { std::string fmt, sep; for (;;) { -#line 790 "src/ast/lex.cc" +#line 784 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -844,9 +838,9 @@ void Scanner::lex_tags(OutputFile &out, bool mtags) } ++YYCURSOR; yy153: -#line 182 "../src/ast/lex.re" +#line 178 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "unrecognized configuration"); } -#line 850 "src/ast/lex.cc" +#line 844 "src/ast/lex.cc" yy154: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -854,14 +848,14 @@ yy154: if (yybm[0+yych] & 128) { goto yy154; } -#line 187 "../src/ast/lex.re" +#line 183 "../src/ast/lex.re" { continue; } -#line 860 "src/ast/lex.cc" +#line 854 "src/ast/lex.cc" yy157: ++YYCURSOR; -#line 188 "../src/ast/lex.re" +#line 184 "../src/ast/lex.re" { ++cline; continue; } -#line 865 "src/ast/lex.cc" +#line 859 "src/ast/lex.cc" yy159: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy157; @@ -880,13 +874,13 @@ yy162: goto yy153; yy163: ++YYCURSOR; -#line 189 "../src/ast/lex.re" +#line 185 "../src/ast/lex.re" { out.wdelay_tags(new ConfTags(fmt, sep), mtags); tok = pos = cur; return; } -#line 890 "src/ast/lex.cc" +#line 884 "src/ast/lex.cc" yy165: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy168; @@ -923,9 +917,9 @@ yy173: goto yy166; yy174: ++YYCURSOR; -#line 184 "../src/ast/lex.re" +#line 180 "../src/ast/lex.re" { fmt = lex_conf_string(); continue; } -#line 929 "src/ast/lex.cc" +#line 923 "src/ast/lex.cc" yy176: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy166; @@ -934,11 +928,11 @@ yy176: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy166; ++YYCURSOR; -#line 185 "../src/ast/lex.re" +#line 181 "../src/ast/lex.re" { sep = lex_conf_string(); continue; } -#line 940 "src/ast/lex.cc" +#line 934 "src/ast/lex.cc" } -#line 194 "../src/ast/lex.re" +#line 190 "../src/ast/lex.re" } } @@ -948,7 +942,7 @@ scan: tchar = cur - pos; tok = cur; -#line 952 "src/ast/lex.cc" +#line 946 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1048,12 +1042,12 @@ scan: yy183: ++YYCURSOR; yy184: -#line 326 "../src/ast/lex.re" +#line 322 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "unexpected character: '%c'", *tok); goto scan; } -#line 1057 "src/ast/lex.cc" +#line 1051 "src/ast/lex.cc" yy185: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1061,9 +1055,9 @@ yy185: if (yybm[0+yych] & 16) { goto yy185; } -#line 307 "../src/ast/lex.re" +#line 303 "../src/ast/lex.re" { goto scan; } -#line 1067 "src/ast/lex.cc" +#line 1061 "src/ast/lex.cc" yy188: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -1074,7 +1068,7 @@ yy188: if (yych == '#') goto yy214; } yy189: -#line 314 "../src/ast/lex.re" +#line 310 "../src/ast/lex.re" { pos = cur; cline++; @@ -1086,7 +1080,7 @@ yy189: goto scan; } } -#line 1090 "src/ast/lex.cc" +#line 1084 "src/ast/lex.cc" yy190: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy188; @@ -1094,14 +1088,14 @@ yy190: yy191: ++YYCURSOR; yy192: -#line 223 "../src/ast/lex.re" +#line 219 "../src/ast/lex.re" { return *tok; } -#line 1100 "src/ast/lex.cc" +#line 1094 "src/ast/lex.cc" yy193: ++YYCURSOR; -#line 213 "../src/ast/lex.re" +#line 209 "../src/ast/lex.re" { yylval.regexp = lex_str('"'); return TOKEN_REGEXP; } -#line 1105 "src/ast/lex.cc" +#line 1099 "src/ast/lex.cc" yy195: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '^') { @@ -1119,21 +1113,21 @@ yy196: goto yy184; yy197: ++YYCURSOR; -#line 212 "../src/ast/lex.re" +#line 208 "../src/ast/lex.re" { yylval.regexp = lex_str('\''); return TOKEN_REGEXP; } -#line 1125 "src/ast/lex.cc" +#line 1119 "src/ast/lex.cc" yy199: yych = (YYCTYPE)*++YYCURSOR; if (yych == '/') goto yy219; goto yy192; yy200: ++YYCURSOR; -#line 302 "../src/ast/lex.re" +#line 298 "../src/ast/lex.re" { yylval.regexp = ast_dot(cline, get_column()); return TOKEN_REGEXP; } -#line 1137 "src/ast/lex.cc" +#line 1131 "src/ast/lex.cc" yy202: yych = (YYCTYPE)*++YYCURSOR; if (yych == '*') goto yy221; @@ -1176,9 +1170,9 @@ yy205: yy206: yych = (YYCTYPE)*++YYCURSOR; if (yych == '^') goto yy233; -#line 214 "../src/ast/lex.re" +#line 210 "../src/ast/lex.re" { yylval.regexp = lex_cls(false); return TOKEN_REGEXP; } -#line 1182 "src/ast/lex.cc" +#line 1176 "src/ast/lex.cc" yy208: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy235; @@ -1201,9 +1195,9 @@ yy209: } } yy210: -#line 203 "../src/ast/lex.re" +#line 199 "../src/ast/lex.re" { lex_code_in_braces(); return TOKEN_CODE; } -#line 1207 "src/ast/lex.cc" +#line 1201 "src/ast/lex.cc" yy211: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1254,38 +1248,38 @@ yy216: } } yy218: -#line 217 "../src/ast/lex.re" +#line 213 "../src/ast/lex.re" { const std::string *name = new std::string(tok + 1, tok_len() - 1); yylval.regexp = ast_tag(cline, get_column(), name, tok[0] == '#'); return TOKEN_REGEXP; } -#line 1264 "src/ast/lex.cc" +#line 1258 "src/ast/lex.cc" yy219: ++YYCURSOR; -#line 210 "../src/ast/lex.re" +#line 206 "../src/ast/lex.re" { tok = cur; return 0; } -#line 1269 "src/ast/lex.cc" +#line 1263 "src/ast/lex.cc" yy221: ++YYCURSOR; -#line 208 "../src/ast/lex.re" +#line 204 "../src/ast/lex.re" { lex_c_comment(); goto scan; } -#line 1274 "src/ast/lex.cc" +#line 1268 "src/ast/lex.cc" yy223: ++YYCURSOR; -#line 207 "../src/ast/lex.re" +#line 203 "../src/ast/lex.re" { lex_cpp_comment(); goto scan; } -#line 1279 "src/ast/lex.cc" +#line 1273 "src/ast/lex.cc" yy225: yych = (YYCTYPE)*++YYCURSOR; if (yych == '>') goto yy243; -#line 204 "../src/ast/lex.re" +#line 200 "../src/ast/lex.re" { lex_code_indented(); return TOKEN_CODE; } -#line 1285 "src/ast/lex.cc" +#line 1279 "src/ast/lex.cc" yy227: ++YYCURSOR; YYCURSOR -= 1; -#line 284 "../src/ast/lex.re" +#line 280 "../src/ast/lex.re" { if (!globopts->FFlag) { yylval.str = new std::string (tok, tok_len()); @@ -1303,7 +1297,7 @@ yy227: return TOKEN_REGEXP; } } -#line 1307 "src/ast/lex.cc" +#line 1301 "src/ast/lex.cc" yy229: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1323,17 +1317,17 @@ yy229: yy231: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 279 "../src/ast/lex.re" +#line 275 "../src/ast/lex.re" { yylval.str = new std::string (tok, tok_len ()); return TOKEN_ID; } -#line 1332 "src/ast/lex.cc" +#line 1326 "src/ast/lex.cc" yy233: ++YYCURSOR; -#line 215 "../src/ast/lex.re" +#line 211 "../src/ast/lex.re" { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; } -#line 1337 "src/ast/lex.cc" +#line 1331 "src/ast/lex.cc" yy235: yych = (YYCTYPE)*++YYCURSOR; if (yych == '2') goto yy247; @@ -1341,12 +1335,12 @@ yy235: yy236: ++YYCURSOR; yy237: -#line 252 "../src/ast/lex.re" +#line 248 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 1350 "src/ast/lex.cc" +#line 1344 "src/ast/lex.cc" yy238: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -1386,13 +1380,13 @@ yy242: yy243: ++YYCURSOR; YYCURSOR -= 2; -#line 205 "../src/ast/lex.re" +#line 201 "../src/ast/lex.re" { return *tok; } -#line 1392 "src/ast/lex.cc" +#line 1386 "src/ast/lex.cc" yy245: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 268 "../src/ast/lex.re" +#line 264 "../src/ast/lex.re" { yylval.str = new std::string (tok, tok_len ()); if (globopts->FFlag) { @@ -1403,7 +1397,7 @@ yy245: return TOKEN_ID; } } -#line 1407 "src/ast/lex.cc" +#line 1401 "src/ast/lex.cc" yy247: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'c') goto yy254; @@ -1417,7 +1411,7 @@ yy248: goto yy237; yy249: ++YYCURSOR; -#line 225 "../src/ast/lex.re" +#line 221 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min)) { fatal_lc(get_cline(), get_column(), "repetition count overflow"); @@ -1425,10 +1419,10 @@ yy249: yylval.bounds.max = yylval.bounds.min; return TOKEN_CLOSESIZE; } -#line 1429 "src/ast/lex.cc" +#line 1423 "src/ast/lex.cc" yy251: ++YYCURSOR; -#line 257 "../src/ast/lex.re" +#line 253 "../src/ast/lex.re" { if (!globopts->FFlag) { fatal_lc(get_cline(), get_column(), @@ -1437,7 +1431,7 @@ yy251: yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces return TOKEN_ID; } -#line 1441 "src/ast/lex.cc" +#line 1435 "src/ast/lex.cc" yy253: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'n') goto yy259; @@ -1456,7 +1450,7 @@ yy255: goto yy213; yy257: ++YYCURSOR; -#line 244 "../src/ast/lex.re" +#line 240 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.bounds.min)) { fatal_lc(get_cline(), get_column(), "repetition lower bound overflow"); @@ -1464,19 +1458,19 @@ yy257: yylval.bounds.max = std::numeric_limits::max(); return TOKEN_CLOSESIZE; } -#line 1468 "src/ast/lex.cc" +#line 1462 "src/ast/lex.cc" yy259: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy264; goto yy213; yy260: ++YYCURSOR; -#line 266 "../src/ast/lex.re" +#line 262 "../src/ast/lex.re" { return TOKEN_CONF; } -#line 1477 "src/ast/lex.cc" +#line 1471 "src/ast/lex.cc" yy262: ++YYCURSOR; -#line 233 "../src/ast/lex.re" +#line 229 "../src/ast/lex.re" { const char * p = strchr (tok, ','); if (!s_to_u32_unsafe (tok + 1, p, yylval.bounds.min)) { @@ -1487,7 +1481,7 @@ yy262: } return TOKEN_CLOSESIZE; } -#line 1491 "src/ast/lex.cc" +#line 1485 "src/ast/lex.cc" yy264: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '0') goto yy266; @@ -1543,12 +1537,12 @@ yy269: yy271: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 309 "../src/ast/lex.re" +#line 305 "../src/ast/lex.re" { set_sourceline (); return TOKEN_LINE_INFO; } -#line 1552 "src/ast/lex.cc" +#line 1546 "src/ast/lex.cc" yy273: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy271; @@ -1574,7 +1568,7 @@ yy277: if (yych == '\n') goto yy213; goto yy274; } -#line 330 "../src/ast/lex.re" +#line 326 "../src/ast/lex.re" } @@ -1584,7 +1578,7 @@ void Scanner::lex_code_indented() tok = cur; code: -#line 1588 "src/ast/lex.cc" +#line 1582 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); @@ -1612,15 +1606,15 @@ code: } yy280: ++YYCURSOR; -#line 347 "../src/ast/lex.re" +#line 343 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 1618 "src/ast/lex.cc" +#line 1612 "src/ast/lex.cc" yy282: ++YYCURSOR; yy283: -#line 352 "../src/ast/lex.re" +#line 348 "../src/ast/lex.re" { goto code; } -#line 1624 "src/ast/lex.cc" +#line 1618 "src/ast/lex.cc" yy284: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '\f') { @@ -1631,23 +1625,23 @@ yy284: if (yych == ' ') goto yy292; } yy285: -#line 340 "../src/ast/lex.re" +#line 336 "../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 1642 "src/ast/lex.cc" +#line 1636 "src/ast/lex.cc" yy286: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy284; goto yy283; yy287: ++YYCURSOR; -#line 351 "../src/ast/lex.re" +#line 347 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 1651 "src/ast/lex.cc" +#line 1645 "src/ast/lex.cc" yy289: yych = (YYCTYPE)*++YYCURSOR; if (yych == '*') goto yy294; @@ -1655,27 +1649,27 @@ yy289: goto yy283; yy290: ++YYCURSOR; -#line 348 "../src/ast/lex.re" +#line 344 "../src/ast/lex.re" { fatal_l(get_cline(), "Curly braces are not allowed after ':='"); } -#line 1661 "src/ast/lex.cc" +#line 1655 "src/ast/lex.cc" yy292: ++YYCURSOR; YYCURSOR -= 1; -#line 339 "../src/ast/lex.re" +#line 335 "../src/ast/lex.re" { goto code; } -#line 1667 "src/ast/lex.cc" +#line 1661 "src/ast/lex.cc" yy294: ++YYCURSOR; -#line 349 "../src/ast/lex.re" +#line 345 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 1672 "src/ast/lex.cc" +#line 1666 "src/ast/lex.cc" yy296: ++YYCURSOR; -#line 350 "../src/ast/lex.re" +#line 346 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 1677 "src/ast/lex.cc" +#line 1671 "src/ast/lex.cc" } -#line 353 "../src/ast/lex.re" +#line 349 "../src/ast/lex.re" } @@ -1685,7 +1679,7 @@ void Scanner::lex_code_in_braces() uint32_t depth = 1; code: -#line 1689 "src/ast/lex.cc" +#line 1683 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1747,15 +1741,15 @@ code: } yy300: ++YYCURSOR; -#line 373 "../src/ast/lex.re" +#line 369 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 1753 "src/ast/lex.cc" +#line 1747 "src/ast/lex.cc" yy302: ++YYCURSOR; yy303: -#line 377 "../src/ast/lex.re" +#line 373 "../src/ast/lex.re" { goto code; } -#line 1759 "src/ast/lex.cc" +#line 1753 "src/ast/lex.cc" yy304: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { @@ -1763,18 +1757,18 @@ yy304: } if (yych == '#') goto yy317; yy305: -#line 372 "../src/ast/lex.re" +#line 368 "../src/ast/lex.re" { pos = cur; cline++; goto code; } -#line 1769 "src/ast/lex.cc" +#line 1763 "src/ast/lex.cc" yy306: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy304; goto yy303; yy307: ++YYCURSOR; -#line 376 "../src/ast/lex.re" +#line 372 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 1778 "src/ast/lex.cc" +#line 1772 "src/ast/lex.cc" yy309: yych = (YYCTYPE)*++YYCURSOR; if (yych == '*') goto yy319; @@ -1782,12 +1776,12 @@ yy309: goto yy303; yy310: ++YYCURSOR; -#line 370 "../src/ast/lex.re" +#line 366 "../src/ast/lex.re" { ++depth; goto code; } -#line 1788 "src/ast/lex.cc" +#line 1782 "src/ast/lex.cc" yy312: ++YYCURSOR; -#line 362 "../src/ast/lex.re" +#line 358 "../src/ast/lex.re" { if (--depth == 0) { yylval.code = new Code(get_fname (), line, tok, tok_len ()); @@ -1795,7 +1789,7 @@ yy312: } goto code; } -#line 1799 "src/ast/lex.cc" +#line 1793 "src/ast/lex.cc" yy314: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1821,14 +1815,14 @@ yy317: } yy319: ++YYCURSOR; -#line 374 "../src/ast/lex.re" +#line 370 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 1827 "src/ast/lex.cc" +#line 1821 "src/ast/lex.cc" yy321: ++YYCURSOR; -#line 375 "../src/ast/lex.re" +#line 371 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 1832 "src/ast/lex.cc" +#line 1826 "src/ast/lex.cc" yy323: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'i') goto yy316; @@ -1885,9 +1879,9 @@ yy331: yy333: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 371 "../src/ast/lex.re" +#line 367 "../src/ast/lex.re" { set_sourceline (); goto code; } -#line 1891 "src/ast/lex.cc" +#line 1885 "src/ast/lex.cc" yy335: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy333; @@ -1913,7 +1907,7 @@ yy339: if (yych == '\n') goto yy316; goto yy336; } -#line 378 "../src/ast/lex.re" +#line 374 "../src/ast/lex.re" } @@ -1921,7 +1915,7 @@ void Scanner::lex_string(char delim) { loop: -#line 1925 "src/ast/lex.cc" +#line 1919 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -1947,29 +1941,29 @@ loop: } yy342: ++YYCURSOR; -#line 388 "../src/ast/lex.re" +#line 384 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 1953 "src/ast/lex.cc" +#line 1947 "src/ast/lex.cc" yy344: ++YYCURSOR; yy345: -#line 389 "../src/ast/lex.re" +#line 385 "../src/ast/lex.re" { goto loop; } -#line 1959 "src/ast/lex.cc" +#line 1953 "src/ast/lex.cc" yy346: ++YYCURSOR; -#line 387 "../src/ast/lex.re" +#line 383 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 1964 "src/ast/lex.cc" +#line 1958 "src/ast/lex.cc" yy348: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy346; goto yy345; yy349: ++YYCURSOR; -#line 385 "../src/ast/lex.re" +#line 381 "../src/ast/lex.re" { if (cur[-1] == delim) return; else goto loop; } -#line 1973 "src/ast/lex.cc" +#line 1967 "src/ast/lex.cc" yy351: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '&') { @@ -1980,11 +1974,11 @@ yy351: } yy352: ++YYCURSOR; -#line 386 "../src/ast/lex.re" +#line 382 "../src/ast/lex.re" { goto loop; } -#line 1986 "src/ast/lex.cc" +#line 1980 "src/ast/lex.cc" } -#line 390 "../src/ast/lex.re" +#line 386 "../src/ast/lex.re" } @@ -1992,7 +1986,7 @@ void Scanner::lex_c_comment() { loop: -#line 1996 "src/ast/lex.cc" +#line 1990 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -2008,20 +2002,20 @@ loop: } yy356: ++YYCURSOR; -#line 399 "../src/ast/lex.re" +#line 395 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2014 "src/ast/lex.cc" +#line 2008 "src/ast/lex.cc" yy358: ++YYCURSOR; yy359: -#line 400 "../src/ast/lex.re" +#line 396 "../src/ast/lex.re" { goto loop; } -#line 2020 "src/ast/lex.cc" +#line 2014 "src/ast/lex.cc" yy360: ++YYCURSOR; -#line 398 "../src/ast/lex.re" +#line 394 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 2025 "src/ast/lex.cc" +#line 2019 "src/ast/lex.cc" yy362: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy360; @@ -2030,11 +2024,11 @@ yy363: yych = (YYCTYPE)*++YYCURSOR; if (yych != '/') goto yy359; ++YYCURSOR; -#line 397 "../src/ast/lex.re" +#line 393 "../src/ast/lex.re" { return; } -#line 2036 "src/ast/lex.cc" +#line 2030 "src/ast/lex.cc" } -#line 401 "../src/ast/lex.re" +#line 397 "../src/ast/lex.re" } @@ -2042,7 +2036,7 @@ void Scanner::lex_cpp_comment() { loop: -#line 2046 "src/ast/lex.cc" +#line 2040 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -2057,26 +2051,26 @@ loop: } yy368: ++YYCURSOR; -#line 409 "../src/ast/lex.re" +#line 405 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2063 "src/ast/lex.cc" +#line 2057 "src/ast/lex.cc" yy370: ++YYCURSOR; yy371: -#line 410 "../src/ast/lex.re" +#line 406 "../src/ast/lex.re" { goto loop; } -#line 2069 "src/ast/lex.cc" +#line 2063 "src/ast/lex.cc" yy372: ++YYCURSOR; -#line 408 "../src/ast/lex.re" +#line 404 "../src/ast/lex.re" { pos = cur; ++cline; return; } -#line 2074 "src/ast/lex.cc" +#line 2068 "src/ast/lex.cc" yy374: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy372; goto yy371; } -#line 411 "../src/ast/lex.re" +#line 407 "../src/ast/lex.re" } @@ -2088,35 +2082,35 @@ fst: tok = cur; c = get_column(); -#line 2092 "src/ast/lex.cc" +#line 2086 "src/ast/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych == ']') goto yy378; -#line 423 "../src/ast/lex.re" +#line 419 "../src/ast/lex.re" { l = lex_cls_chr(); goto snd; } -#line 2100 "src/ast/lex.cc" +#line 2094 "src/ast/lex.cc" yy378: ++YYCURSOR; -#line 422 "../src/ast/lex.re" +#line 418 "../src/ast/lex.re" { return ast_cls(cline, c0, cls, neg); } -#line 2105 "src/ast/lex.cc" +#line 2099 "src/ast/lex.cc" } -#line 424 "../src/ast/lex.re" +#line 420 "../src/ast/lex.re" snd: -#line 2111 "src/ast/lex.cc" +#line 2105 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*(YYMARKER = YYCURSOR); if (yych == '-') goto yy383; yy382: -#line 427 "../src/ast/lex.re" +#line 423 "../src/ast/lex.re" { u = l; goto add; } -#line 2120 "src/ast/lex.cc" +#line 2114 "src/ast/lex.cc" yy383: yych = (YYCTYPE)*++YYCURSOR; if (yych != ']') goto yy385; @@ -2125,7 +2119,7 @@ yy383: yy385: ++YYCURSOR; YYCURSOR -= 1; -#line 428 "../src/ast/lex.re" +#line 424 "../src/ast/lex.re" { u = lex_cls_chr(); if (l > u) { @@ -2134,9 +2128,9 @@ yy385: } goto add; } -#line 2138 "src/ast/lex.cc" +#line 2132 "src/ast/lex.cc" } -#line 436 "../src/ast/lex.re" +#line 432 "../src/ast/lex.re" add: cls->push_back(ASTRange(l, u, c)); @@ -2148,7 +2142,7 @@ uint32_t Scanner::lex_cls_chr() tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 2152 "src/ast/lex.cc" +#line 2146 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -2165,20 +2159,20 @@ uint32_t Scanner::lex_cls_chr() } yy389: ++YYCURSOR; -#line 448 "../src/ast/lex.re" +#line 444 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 2171 "src/ast/lex.cc" +#line 2165 "src/ast/lex.cc" yy391: ++YYCURSOR; yy392: -#line 454 "../src/ast/lex.re" +#line 450 "../src/ast/lex.re" { return static_cast(tok[0]); } -#line 2177 "src/ast/lex.cc" +#line 2171 "src/ast/lex.cc" yy393: ++YYCURSOR; -#line 449 "../src/ast/lex.re" +#line 445 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character class"); } -#line 2182 "src/ast/lex.cc" +#line 2176 "src/ast/lex.cc" yy395: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy393; @@ -2237,36 +2231,36 @@ yy396: } } yy397: -#line 452 "../src/ast/lex.re" +#line 448 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 2243 "src/ast/lex.cc" +#line 2237 "src/ast/lex.cc" yy398: ++YYCURSOR; yy399: -#line 467 "../src/ast/lex.re" +#line 463 "../src/ast/lex.re" { warn.useless_escape(cline, get_column(), tok[1]); return static_cast(tok[1]); } -#line 2252 "src/ast/lex.cc" +#line 2246 "src/ast/lex.cc" yy400: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy393; goto yy399; yy401: ++YYCURSOR; -#line 465 "../src/ast/lex.re" +#line 461 "../src/ast/lex.re" { return static_cast('-'); } -#line 2261 "src/ast/lex.cc" +#line 2255 "src/ast/lex.cc" yy403: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy404; if (yych <= '7') goto yy428; yy404: -#line 451 "../src/ast/lex.re" +#line 447 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 2270 "src/ast/lex.cc" +#line 2264 "src/ast/lex.cc" yy405: ++YYCURSOR; goto yy404; @@ -2282,9 +2276,9 @@ yy406: if (yych <= 'f') goto yy430; } yy407: -#line 450 "../src/ast/lex.re" +#line 446 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 2288 "src/ast/lex.cc" +#line 2282 "src/ast/lex.cc" yy408: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2300,49 +2294,49 @@ yy408: } yy409: ++YYCURSOR; -#line 464 "../src/ast/lex.re" +#line 460 "../src/ast/lex.re" { return static_cast('\\'); } -#line 2306 "src/ast/lex.cc" +#line 2300 "src/ast/lex.cc" yy411: ++YYCURSOR; -#line 466 "../src/ast/lex.re" +#line 462 "../src/ast/lex.re" { return static_cast(']'); } -#line 2311 "src/ast/lex.cc" +#line 2305 "src/ast/lex.cc" yy413: ++YYCURSOR; -#line 457 "../src/ast/lex.re" +#line 453 "../src/ast/lex.re" { return static_cast('\a'); } -#line 2316 "src/ast/lex.cc" +#line 2310 "src/ast/lex.cc" yy415: ++YYCURSOR; -#line 458 "../src/ast/lex.re" +#line 454 "../src/ast/lex.re" { return static_cast('\b'); } -#line 2321 "src/ast/lex.cc" +#line 2315 "src/ast/lex.cc" yy417: ++YYCURSOR; -#line 459 "../src/ast/lex.re" +#line 455 "../src/ast/lex.re" { return static_cast('\f'); } -#line 2326 "src/ast/lex.cc" +#line 2320 "src/ast/lex.cc" yy419: ++YYCURSOR; -#line 460 "../src/ast/lex.re" +#line 456 "../src/ast/lex.re" { return static_cast('\n'); } -#line 2331 "src/ast/lex.cc" +#line 2325 "src/ast/lex.cc" yy421: ++YYCURSOR; -#line 461 "../src/ast/lex.re" +#line 457 "../src/ast/lex.re" { return static_cast('\r'); } -#line 2336 "src/ast/lex.cc" +#line 2330 "src/ast/lex.cc" yy423: ++YYCURSOR; -#line 462 "../src/ast/lex.re" +#line 458 "../src/ast/lex.re" { return static_cast('\t'); } -#line 2341 "src/ast/lex.cc" +#line 2335 "src/ast/lex.cc" yy425: ++YYCURSOR; -#line 463 "../src/ast/lex.re" +#line 459 "../src/ast/lex.re" { return static_cast('\v'); } -#line 2346 "src/ast/lex.cc" +#line 2340 "src/ast/lex.cc" yy427: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2405,9 +2399,9 @@ yy432: } yy433: ++YYCURSOR; -#line 456 "../src/ast/lex.re" +#line 452 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 2411 "src/ast/lex.cc" +#line 2405 "src/ast/lex.cc" yy435: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2434,9 +2428,9 @@ yy436: } yy437: ++YYCURSOR; -#line 455 "../src/ast/lex.re" +#line 451 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 2440 "src/ast/lex.cc" +#line 2434 "src/ast/lex.cc" yy439: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2460,7 +2454,7 @@ yy440: goto yy429; } } -#line 471 "../src/ast/lex.re" +#line 467 "../src/ast/lex.re" } @@ -2470,7 +2464,7 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 2474 "src/ast/lex.cc" +#line 2468 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -2487,23 +2481,23 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) } yy443: ++YYCURSOR; -#line 481 "../src/ast/lex.re" +#line 477 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 2493 "src/ast/lex.cc" +#line 2487 "src/ast/lex.cc" yy445: ++YYCURSOR; yy446: -#line 487 "../src/ast/lex.re" +#line 483 "../src/ast/lex.re" { end = tok[0] == quote; return static_cast(tok[0]); } -#line 2502 "src/ast/lex.cc" +#line 2496 "src/ast/lex.cc" yy447: ++YYCURSOR; -#line 482 "../src/ast/lex.re" +#line 478 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character string"); } -#line 2507 "src/ast/lex.cc" +#line 2501 "src/ast/lex.cc" yy449: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy447; @@ -2557,20 +2551,20 @@ yy450: } } yy451: -#line 485 "../src/ast/lex.re" +#line 481 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 2563 "src/ast/lex.cc" +#line 2557 "src/ast/lex.cc" yy452: ++YYCURSOR; yy453: -#line 501 "../src/ast/lex.re" +#line 497 "../src/ast/lex.re" { if (tok[1] != quote) { warn.useless_escape(cline, get_column(), tok[1]); } return static_cast(tok[1]); } -#line 2574 "src/ast/lex.cc" +#line 2568 "src/ast/lex.cc" yy454: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy447; @@ -2581,9 +2575,9 @@ yy455: if (yych <= '/') goto yy456; if (yych <= '7') goto yy478; yy456: -#line 484 "../src/ast/lex.re" +#line 480 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 2587 "src/ast/lex.cc" +#line 2581 "src/ast/lex.cc" yy457: ++YYCURSOR; goto yy456; @@ -2599,9 +2593,9 @@ yy458: if (yych <= 'f') goto yy480; } yy459: -#line 483 "../src/ast/lex.re" +#line 479 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 2605 "src/ast/lex.cc" +#line 2599 "src/ast/lex.cc" yy460: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2617,44 +2611,44 @@ yy460: } yy461: ++YYCURSOR; -#line 500 "../src/ast/lex.re" +#line 496 "../src/ast/lex.re" { return static_cast('\\'); } -#line 2623 "src/ast/lex.cc" +#line 2617 "src/ast/lex.cc" yy463: ++YYCURSOR; -#line 493 "../src/ast/lex.re" +#line 489 "../src/ast/lex.re" { return static_cast('\a'); } -#line 2628 "src/ast/lex.cc" +#line 2622 "src/ast/lex.cc" yy465: ++YYCURSOR; -#line 494 "../src/ast/lex.re" +#line 490 "../src/ast/lex.re" { return static_cast('\b'); } -#line 2633 "src/ast/lex.cc" +#line 2627 "src/ast/lex.cc" yy467: ++YYCURSOR; -#line 495 "../src/ast/lex.re" +#line 491 "../src/ast/lex.re" { return static_cast('\f'); } -#line 2638 "src/ast/lex.cc" +#line 2632 "src/ast/lex.cc" yy469: ++YYCURSOR; -#line 496 "../src/ast/lex.re" +#line 492 "../src/ast/lex.re" { return static_cast('\n'); } -#line 2643 "src/ast/lex.cc" +#line 2637 "src/ast/lex.cc" yy471: ++YYCURSOR; -#line 497 "../src/ast/lex.re" +#line 493 "../src/ast/lex.re" { return static_cast('\r'); } -#line 2648 "src/ast/lex.cc" +#line 2642 "src/ast/lex.cc" yy473: ++YYCURSOR; -#line 498 "../src/ast/lex.re" +#line 494 "../src/ast/lex.re" { return static_cast('\t'); } -#line 2653 "src/ast/lex.cc" +#line 2647 "src/ast/lex.cc" yy475: ++YYCURSOR; -#line 499 "../src/ast/lex.re" +#line 495 "../src/ast/lex.re" { return static_cast('\v'); } -#line 2658 "src/ast/lex.cc" +#line 2652 "src/ast/lex.cc" yy477: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2717,9 +2711,9 @@ yy482: } yy483: ++YYCURSOR; -#line 492 "../src/ast/lex.re" +#line 488 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 2723 "src/ast/lex.cc" +#line 2717 "src/ast/lex.cc" yy485: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2746,9 +2740,9 @@ yy486: } yy487: ++YYCURSOR; -#line 491 "../src/ast/lex.re" +#line 487 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 2752 "src/ast/lex.cc" +#line 2746 "src/ast/lex.cc" yy489: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2772,7 +2766,7 @@ yy490: goto yy479; } } -#line 507 "../src/ast/lex.re" +#line 503 "../src/ast/lex.re" } @@ -2792,7 +2786,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 2796 "src/ast/lex.cc" +#line 2790 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2850,27 +2844,27 @@ sourceline: } } ++YYCURSOR; -#line 544 "../src/ast/lex.re" +#line 540 "../src/ast/lex.re" { --cur; tok = cur; return; } -#line 2860 "src/ast/lex.cc" +#line 2854 "src/ast/lex.cc" yy495: ++YYCURSOR; yy496: -#line 550 "../src/ast/lex.re" +#line 546 "../src/ast/lex.re" { goto sourceline; } -#line 2866 "src/ast/lex.cc" +#line 2860 "src/ast/lex.cc" yy497: ++YYCURSOR; -#line 539 "../src/ast/lex.re" +#line 535 "../src/ast/lex.re" { tok = cur; return; } -#line 2874 "src/ast/lex.cc" +#line 2868 "src/ast/lex.cc" yy499: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy497; @@ -2887,14 +2881,14 @@ yy501: if (yybm[0+yych] & 64) { goto yy501; } -#line 526 "../src/ast/lex.re" +#line 522 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { fatal_lc(get_cline(), get_column(), "line number overflow"); } goto sourceline; } -#line 2898 "src/ast/lex.cc" +#line 2892 "src/ast/lex.cc" yy504: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2911,13 +2905,13 @@ yy506: goto yy496; yy507: ++YYCURSOR; -#line 533 "../src/ast/lex.re" +#line 529 "../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 2921 "src/ast/lex.cc" +#line 2915 "src/ast/lex.cc" yy509: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2926,7 +2920,7 @@ yy509: if (yych == '\n') goto yy506; goto yy504; } -#line 551 "../src/ast/lex.re" +#line 547 "../src/ast/lex.re" } diff --git a/re2c/src/ast/lex.re b/re2c/src/ast/lex.re index 7dea1db0..2040f798 100644 --- a/re2c/src/ast/lex.re +++ b/re2c/src/ast/lex.re @@ -30,32 +30,28 @@ extern YYSTYPE yylval; namespace re2c { -// source code is in ASCII: pointers have type 'char *' -// but re2c makes an implicit assumption that YYCTYPE is unsigned -// when it generates comparisons /*!re2c + // source code is in ASCII: pointers have type 'char *', but re2c makes + // assumes that YYCTYPE is unsigned when generating comparisons re2c:yych:conversion = 1; -*/ -/*!re2c -eof = "\000"; -dstring = "\"" ([^\x00\n\\"] | "\\" [^\x00\n])* "\""; -sstring = "'" ([^\x00\n\\'] | "\\" [^\x00\n])* "'" ; -letter = [a-zA-Z]; -digit = [0-9]; -lineno = [1-9] digit*; -name = (letter|"_") (letter|digit|"_")*; -space = [ \t]; -ws = (space | [\r\n]); -eol = "\r"? "\n"; -eoc = "*" "/"; -linedir = eol space* "#" space* "line" space+; -lineinf = lineno (space+ dstring)? eol; - - esc = "\\"; - hex_digit = [0-9a-fA-F]; - esc_hex = esc ("x" hex_digit{2} | [uX] hex_digit{4} | "U" hex_digit{8}); - esc_oct = esc [0-3] [0-7]{2}; // max 1-byte octal value is '\377' + eof = "\000"; + dstring = "\"" ([^\x00\n\\"] | "\\" [^\x00\n])* "\""; + sstring = "'" ([^\x00\n\\'] | "\\" [^\x00\n])* "'" ; + letter = [a-zA-Z]; + digit = [0-9]; + lineno = [1-9] digit*; + name = (letter|"_") (letter|digit|"_")*; + space = [ \t]; + ws = (space | [\r\n]); + eol = "\r"? "\n"; + eoc = "*" "/"; + linedir = eol space* "#" space* "line" space+; + lineinf = lineno (space+ dstring)? eol; + esc = "\\"; + hex_digit = [0-9a-fA-F]; + esc_hex = esc ("x" hex_digit{2} | [uX] hex_digit{4} | "U" hex_digit{8}); + esc_oct = esc [0-3] [0-7]{2}; // max 1-byte octal value is '\377' esc_simple = esc [abfnrtv\\]; */ -- 2.40.0