-/* Generated by re2c 0.16 on Sun Mar 5 11:49:42 2017 */
+/* Generated by re2c 0.16 on Mon Mar 6 08:43:45 2017 */
#line 1 "../src/ast/lex.re"
#include "src/util/c99_stdint.h"
#include <stddef.h>
yy159:
++YYCURSOR;
yy160:
-#line 378 "../src/ast/lex.re"
+#line 375 "../src/ast/lex.re"
{
fatalf("unexpected character: '%c'", *tok);
goto scan;
if (yybm[0+yych] & 16) {
goto yy161;
}
-#line 362 "../src/ast/lex.re"
+#line 359 "../src/ast/lex.re"
{
goto scan;
}
if (yych == '#') goto yy190;
}
yy165:
-#line 371 "../src/ast/lex.re"
+#line 368 "../src/ast/lex.re"
{
if (cur == eof) return 0;
pos = cur;
yy169:
++YYCURSOR;
#line 259 "../src/ast/lex.re"
- { yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return TOKEN_REGEXP; }
+ { yylval.regexp = lex_str('"'); return TOKEN_REGEXP; }
#line 1035 "src/ast/lex.cc"
yy171:
yych = (YYCTYPE)*++YYCURSOR;
yy172:
++YYCURSOR;
#line 258 "../src/ast/lex.re"
- { yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return TOKEN_REGEXP; }
+ { yylval.regexp = lex_str('\''); return TOKEN_REGEXP; }
#line 1044 "src/ast/lex.cc"
yy174:
yych = (YYCTYPE)*++YYCURSOR;
goto yy168;
yy175:
++YYCURSOR;
-#line 357 "../src/ast/lex.re"
+#line 354 "../src/ast/lex.re"
{
yylval.regexp = ast_dot(cline, get_column());
return TOKEN_REGEXP;
yylval.str = new std::string (tok, tok_len());
return TOKEN_ID;
} else {
- const AST *r = NULL;
- const bool casing = opts->bCaseInsensitive || opts->bCaseInverted;
+ std::vector<ASTChar> *str = new std::vector<ASTChar>;
for (char *s = tok; s < cur; ++s) {
const uint32_t
- c = static_cast<uint8_t>(*s),
- column = static_cast<uint32_t>(s - pos);
- r = ast_cat(r, casing
- ? ast_ichar(cline, column, c)
- : ast_schar(cline, column, c));
+ chr = static_cast<uint8_t>(*s),
+ col = static_cast<uint32_t>(s - ptr);
+ str->push_back(ASTChar(chr, col));
}
- yylval.regexp = r ? r : ast_nil(cline, get_column());
+ yylval.regexp = ast_str(cline, get_column(), str, false);
return TOKEN_REGEXP;
}
}
-#line 1227 "src/ast/lex.cc"
+#line 1224 "src/ast/lex.cc"
yy200:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yylval.str = new std::string (tok, tok_len ());
return TOKEN_ID;
}
-#line 1252 "src/ast/lex.cc"
+#line 1249 "src/ast/lex.cc"
yy204:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '>') goto yy221;
code_line = cline;
goto code;
}
-#line 1263 "src/ast/lex.cc"
+#line 1260 "src/ast/lex.cc"
yy206:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yylval.regexp = ast_tag(cline, get_column(), name);
return TOKEN_REGEXP;
}
-#line 1290 "src/ast/lex.cc"
+#line 1287 "src/ast/lex.cc"
yy209:
++YYCURSOR;
#line 261 "../src/ast/lex.re"
{ yylval.regexp = lex_cls(true); return TOKEN_REGEXP; }
-#line 1295 "src/ast/lex.cc"
+#line 1292 "src/ast/lex.cc"
yy211:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy223;
{
fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers");
}
-#line 1307 "src/ast/lex.cc"
+#line 1304 "src/ast/lex.cc"
yy214:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
return TOKEN_ID;
}
}
-#line 1373 "src/ast/lex.cc"
+#line 1370 "src/ast/lex.cc"
yy221:
++YYCURSOR;
YYCURSOR -= 2;
{
return *tok;
}
-#line 1381 "src/ast/lex.cc"
+#line 1378 "src/ast/lex.cc"
yy223:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'c') goto yy230;
yylval.bounds.max = yylval.bounds.min;
return TOKEN_CLOSESIZE;
}
-#line 1404 "src/ast/lex.cc"
+#line 1401 "src/ast/lex.cc"
yy227:
++YYCURSOR;
#line 309 "../src/ast/lex.re"
yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
return TOKEN_ID;
}
-#line 1415 "src/ast/lex.cc"
+#line 1412 "src/ast/lex.cc"
yy229:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'n') goto yy235;
yylval.bounds.max = std::numeric_limits<uint32_t>::max();
return TOKEN_CLOSESIZE;
}
-#line 1443 "src/ast/lex.cc"
+#line 1440 "src/ast/lex.cc"
yy235:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy240;
++YYCURSOR;
#line 317 "../src/ast/lex.re"
{ lex_conf (); return TOKEN_CONF; }
-#line 1452 "src/ast/lex.cc"
+#line 1449 "src/ast/lex.cc"
yy238:
++YYCURSOR;
#line 283 "../src/ast/lex.re"
}
return TOKEN_CLOSESIZE;
}
-#line 1468 "src/ast/lex.cc"
+#line 1465 "src/ast/lex.cc"
yy240:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '0') goto yy242;
yy247:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 366 "../src/ast/lex.re"
+#line 363 "../src/ast/lex.re"
{
set_sourceline ();
goto scan;
}
-#line 1529 "src/ast/lex.cc"
+#line 1526 "src/ast/lex.cc"
yy249:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy247;
if (yych == '\n') goto yy189;
goto yy250;
}
-#line 382 "../src/ast/lex.re"
+#line 379 "../src/ast/lex.re"
flex_name:
-#line 1559 "src/ast/lex.cc"
+#line 1556 "src/ast/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
if (yych == '\r') goto yy260;
++YYCURSOR;
yy257:
-#line 393 "../src/ast/lex.re"
+#line 390 "../src/ast/lex.re"
{
YYCURSOR = tok;
goto start;
}
-#line 1573 "src/ast/lex.cc"
+#line 1570 "src/ast/lex.cc"
yy258:
++YYCURSOR;
-#line 387 "../src/ast/lex.re"
+#line 384 "../src/ast/lex.re"
{
YYCURSOR = tok;
lexer_state = LEX_NORMAL;
return TOKEN_FID_END;
}
-#line 1582 "src/ast/lex.cc"
+#line 1579 "src/ast/lex.cc"
yy260:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy258;
goto yy257;
}
-#line 397 "../src/ast/lex.re"
+#line 394 "../src/ast/lex.re"
code:
-#line 1593 "src/ast/lex.cc"
+#line 1590 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
yy263:
++YYCURSOR;
-#line 460 "../src/ast/lex.re"
+#line 457 "../src/ast/lex.re"
{
if (cur == eof)
{
}
goto code;
}
-#line 1666 "src/ast/lex.cc"
+#line 1663 "src/ast/lex.cc"
yy265:
++YYCURSOR;
yy266:
-#line 474 "../src/ast/lex.re"
+#line 471 "../src/ast/lex.re"
{
goto code;
}
-#line 1674 "src/ast/lex.cc"
+#line 1671 "src/ast/lex.cc"
yy267:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
}
yy268:
-#line 441 "../src/ast/lex.re"
+#line 438 "../src/ast/lex.re"
{
if (depth == 0)
{
cline++;
goto code;
}
-#line 1713 "src/ast/lex.cc"
+#line 1710 "src/ast/lex.cc"
yy269:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
goto yy287;
yy271:
++YYCURSOR;
-#line 413 "../src/ast/lex.re"
+#line 410 "../src/ast/lex.re"
{
if (depth == 0)
{
}
goto code;
}
-#line 1738 "src/ast/lex.cc"
+#line 1735 "src/ast/lex.cc"
yy273:
++YYCURSOR;
-#line 401 "../src/ast/lex.re"
+#line 398 "../src/ast/lex.re"
{
if (depth == 0)
{
}
goto code;
}
-#line 1754 "src/ast/lex.cc"
+#line 1751 "src/ast/lex.cc"
yy275:
yyaccept = 2;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy276:
YYCURSOR -= 1;
-#line 428 "../src/ast/lex.re"
+#line 425 "../src/ast/lex.re"
{
if (depth == 0)
{
cline++;
goto code;
}
-#line 1780 "src/ast/lex.cc"
+#line 1777 "src/ast/lex.cc"
yy277:
++YYCURSOR;
goto yy276;
if (yych >= '#') goto yy285;
yy283:
++YYCURSOR;
-#line 471 "../src/ast/lex.re"
+#line 468 "../src/ast/lex.re"
{
goto code;
}
-#line 1819 "src/ast/lex.cc"
+#line 1816 "src/ast/lex.cc"
yy285:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yy301:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 424 "../src/ast/lex.re"
+#line 421 "../src/ast/lex.re"
{
set_sourceline ();
goto code;
}
-#line 1914 "src/ast/lex.cc"
+#line 1911 "src/ast/lex.cc"
yy303:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy301;
if (yych == '\n') goto yy280;
goto yy304;
}
-#line 477 "../src/ast/lex.re"
+#line 474 "../src/ast/lex.re"
comment:
-#line 1948 "src/ast/lex.cc"
+#line 1945 "src/ast/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
++YYCURSOR;
yy311:
-#line 509 "../src/ast/lex.re"
+#line 506 "../src/ast/lex.re"
{
if (cur == eof)
{
}
goto comment;
}
-#line 2003 "src/ast/lex.cc"
+#line 2000 "src/ast/lex.cc"
yy312:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
}
if (yych == '#') goto yy319;
yy313:
-#line 500 "../src/ast/lex.re"
+#line 497 "../src/ast/lex.re"
{
if (cur == eof)
{
cline++;
goto comment;
}
-#line 2021 "src/ast/lex.cc"
+#line 2018 "src/ast/lex.cc"
yy314:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '/') goto yy321;
}
yy321:
++YYCURSOR;
-#line 481 "../src/ast/lex.re"
+#line 478 "../src/ast/lex.re"
{
if (--depth == 0)
{
goto comment;
}
}
-#line 2066 "src/ast/lex.cc"
+#line 2063 "src/ast/lex.cc"
yy323:
++YYCURSOR;
-#line 491 "../src/ast/lex.re"
+#line 488 "../src/ast/lex.re"
{
++depth;
fatal("ambiguous /* found");
goto comment;
}
-#line 2075 "src/ast/lex.cc"
+#line 2072 "src/ast/lex.cc"
yy325:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'i') goto yy318;
yy335:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 496 "../src/ast/lex.re"
+#line 493 "../src/ast/lex.re"
{
set_sourceline ();
goto comment;
}
-#line 2137 "src/ast/lex.cc"
+#line 2134 "src/ast/lex.cc"
yy337:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy335;
if (yych == '\n') goto yy318;
goto yy338;
}
-#line 516 "../src/ast/lex.re"
+#line 513 "../src/ast/lex.re"
nextLine:
-#line 2167 "src/ast/lex.cc"
+#line 2164 "src/ast/lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych == '\n') goto yy346;
++YYCURSOR;
-#line 527 "../src/ast/lex.re"
+#line 524 "../src/ast/lex.re"
{ if(cur == eof) {
return 0;
}
goto nextLine;
}
-#line 2180 "src/ast/lex.cc"
+#line 2177 "src/ast/lex.cc"
yy346:
++YYCURSOR;
-#line 520 "../src/ast/lex.re"
+#line 517 "../src/ast/lex.re"
{ if(cur == eof) {
return 0;
}
cline++;
goto scan;
}
-#line 2191 "src/ast/lex.cc"
+#line 2188 "src/ast/lex.cc"
}
-#line 532 "../src/ast/lex.re"
+#line 529 "../src/ast/lex.re"
}
const AST *Scanner::lex_cls(bool neg)
{
- const uint32_t column = get_column();
- Range *r = NULL, *s;
- uint32_t u, l;
+ std::vector<ASTRange> *cls = new std::vector<ASTRange>;
+ uint32_t u, l, c, c0 = get_column();
fst:
+ tok = cur;
+ c = get_column();
-#line 2218 "src/ast/lex.cc"
+#line 2216 "src/ast/lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych == ']') goto yy351;
-#line 557 "../src/ast/lex.re"
+#line 555 "../src/ast/lex.re"
{ l = lex_cls_chr(); goto snd; }
-#line 2226 "src/ast/lex.cc"
+#line 2224 "src/ast/lex.cc"
yy351:
++YYCURSOR;
-#line 556 "../src/ast/lex.re"
- { goto end; }
-#line 2231 "src/ast/lex.cc"
+#line 554 "../src/ast/lex.re"
+ { return ast_cls(cline, c0, cls, neg); }
+#line 2229 "src/ast/lex.cc"
}
-#line 558 "../src/ast/lex.re"
+#line 556 "../src/ast/lex.re"
snd:
-#line 2237 "src/ast/lex.cc"
+#line 2235 "src/ast/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*(YYMARKER = YYCURSOR);
if (yych == '-') goto yy356;
yy355:
-#line 561 "../src/ast/lex.re"
+#line 559 "../src/ast/lex.re"
{ u = l; goto add; }
-#line 2246 "src/ast/lex.cc"
+#line 2244 "src/ast/lex.cc"
yy356:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != ']') goto yy358;
yy358:
++YYCURSOR;
YYCURSOR -= 1;
-#line 562 "../src/ast/lex.re"
+#line 560 "../src/ast/lex.re"
{
u = lex_cls_chr();
if (l > u) {
}
goto add;
}
-#line 2264 "src/ast/lex.cc"
+#line 2262 "src/ast/lex.cc"
}
-#line 570 "../src/ast/lex.re"
+#line 568 "../src/ast/lex.re"
add:
- if (!(s = opts->encoding.encodeRange(l, u))) {
- fatalf ("Bad code point range: '0x%X - 0x%X'", l, u);
- }
- r = Range::add(r, s);
+ cls->push_back(ASTRange(l, u, c));
goto fst;
-end:
- if (neg) {
- r = Range::sub(opts->encoding.fullRange(), r);
- }
- return ast_class(cline, column, r);
}
uint32_t Scanner::lex_cls_chr()
{
tok = cur;
-#line 2285 "src/ast/lex.cc"
+#line 2275 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if (yych == '\n') goto yy364;
if (yych == '\\') goto yy366;
++YYCURSOR;
-#line 593 "../src/ast/lex.re"
+#line 583 "../src/ast/lex.re"
{ return static_cast<uint8_t>(tok[0]); }
-#line 2296 "src/ast/lex.cc"
+#line 2286 "src/ast/lex.cc"
yy364:
++YYCURSOR;
-#line 588 "../src/ast/lex.re"
+#line 578 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error"); }
-#line 2301 "src/ast/lex.cc"
+#line 2291 "src/ast/lex.cc"
yy366:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '`') {
}
}
}
-#line 591 "../src/ast/lex.re"
+#line 581 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error in escape sequence"); }
-#line 2352 "src/ast/lex.cc"
+#line 2342 "src/ast/lex.cc"
yy368:
++YYCURSOR;
-#line 606 "../src/ast/lex.re"
+#line 596 "../src/ast/lex.re"
{
warn.useless_escape(cline, get_column(), tok[1]);
return static_cast<uint8_t>(tok[1]);
}
-#line 2360 "src/ast/lex.cc"
+#line 2350 "src/ast/lex.cc"
yy370:
++YYCURSOR;
-#line 604 "../src/ast/lex.re"
+#line 594 "../src/ast/lex.re"
{ return static_cast<uint8_t>('-'); }
-#line 2365 "src/ast/lex.cc"
+#line 2355 "src/ast/lex.cc"
yy372:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy373;
if (yych <= '7') goto yy397;
yy373:
-#line 590 "../src/ast/lex.re"
+#line 580 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error in octal escape sequence"); }
-#line 2374 "src/ast/lex.cc"
+#line 2364 "src/ast/lex.cc"
yy374:
++YYCURSOR;
goto yy373;
if (yych <= 'f') goto yy399;
}
yy376:
-#line 589 "../src/ast/lex.re"
+#line 579 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error in hexadecimal escape sequence"); }
-#line 2392 "src/ast/lex.cc"
+#line 2382 "src/ast/lex.cc"
yy377:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy378:
++YYCURSOR;
-#line 603 "../src/ast/lex.re"
+#line 593 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\\'); }
-#line 2410 "src/ast/lex.cc"
+#line 2400 "src/ast/lex.cc"
yy380:
++YYCURSOR;
-#line 605 "../src/ast/lex.re"
+#line 595 "../src/ast/lex.re"
{ return static_cast<uint8_t>(']'); }
-#line 2415 "src/ast/lex.cc"
+#line 2405 "src/ast/lex.cc"
yy382:
++YYCURSOR;
-#line 596 "../src/ast/lex.re"
+#line 586 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\a'); }
-#line 2420 "src/ast/lex.cc"
+#line 2410 "src/ast/lex.cc"
yy384:
++YYCURSOR;
-#line 597 "../src/ast/lex.re"
+#line 587 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\b'); }
-#line 2425 "src/ast/lex.cc"
+#line 2415 "src/ast/lex.cc"
yy386:
++YYCURSOR;
-#line 598 "../src/ast/lex.re"
+#line 588 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\f'); }
-#line 2430 "src/ast/lex.cc"
+#line 2420 "src/ast/lex.cc"
yy388:
++YYCURSOR;
-#line 599 "../src/ast/lex.re"
+#line 589 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\n'); }
-#line 2435 "src/ast/lex.cc"
+#line 2425 "src/ast/lex.cc"
yy390:
++YYCURSOR;
-#line 600 "../src/ast/lex.re"
+#line 590 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\r'); }
-#line 2440 "src/ast/lex.cc"
+#line 2430 "src/ast/lex.cc"
yy392:
++YYCURSOR;
-#line 601 "../src/ast/lex.re"
+#line 591 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\t'); }
-#line 2445 "src/ast/lex.cc"
+#line 2435 "src/ast/lex.cc"
yy394:
++YYCURSOR;
-#line 602 "../src/ast/lex.re"
+#line 592 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\v'); }
-#line 2450 "src/ast/lex.cc"
+#line 2440 "src/ast/lex.cc"
yy396:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy402:
++YYCURSOR;
-#line 595 "../src/ast/lex.re"
+#line 585 "../src/ast/lex.re"
{ return unesc_oct(tok, cur); }
-#line 2515 "src/ast/lex.cc"
+#line 2505 "src/ast/lex.cc"
yy404:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
}
yy406:
++YYCURSOR;
-#line 594 "../src/ast/lex.re"
+#line 584 "../src/ast/lex.re"
{ return unesc_hex(tok, cur); }
-#line 2544 "src/ast/lex.cc"
+#line 2534 "src/ast/lex.cc"
yy408:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
goto yy398;
}
}
-#line 610 "../src/ast/lex.re"
+#line 600 "../src/ast/lex.re"
}
end = false;
tok = cur;
-#line 2577 "src/ast/lex.cc"
+#line 2567 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if (yych == '\n') goto yy414;
if (yych == '\\') goto yy416;
++YYCURSOR;
-#line 623 "../src/ast/lex.re"
+#line 613 "../src/ast/lex.re"
{
end = tok[0] == quote;
return static_cast<uint8_t>(tok[0]);
}
-#line 2591 "src/ast/lex.cc"
+#line 2581 "src/ast/lex.cc"
yy414:
++YYCURSOR;
-#line 618 "../src/ast/lex.re"
+#line 608 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error"); }
-#line 2596 "src/ast/lex.cc"
+#line 2586 "src/ast/lex.cc"
yy416:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 'a') {
}
}
}
-#line 621 "../src/ast/lex.re"
+#line 611 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error in escape sequence"); }
-#line 2644 "src/ast/lex.cc"
+#line 2634 "src/ast/lex.cc"
yy418:
++YYCURSOR;
-#line 637 "../src/ast/lex.re"
+#line 627 "../src/ast/lex.re"
{
if (tok[1] != quote) {
warn.useless_escape(cline, get_column(), tok[1]);
}
return static_cast<uint8_t>(tok[1]);
}
-#line 2654 "src/ast/lex.cc"
+#line 2644 "src/ast/lex.cc"
yy420:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy421;
if (yych <= '7') goto yy443;
yy421:
-#line 620 "../src/ast/lex.re"
+#line 610 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error in octal escape sequence"); }
-#line 2663 "src/ast/lex.cc"
+#line 2653 "src/ast/lex.cc"
yy422:
++YYCURSOR;
goto yy421;
if (yych <= 'f') goto yy445;
}
yy424:
-#line 619 "../src/ast/lex.re"
+#line 609 "../src/ast/lex.re"
{ fatal (get_column() - tchar, "syntax error in hexadecimal escape sequence"); }
-#line 2681 "src/ast/lex.cc"
+#line 2671 "src/ast/lex.cc"
yy425:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy426:
++YYCURSOR;
-#line 636 "../src/ast/lex.re"
+#line 626 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\\'); }
-#line 2699 "src/ast/lex.cc"
+#line 2689 "src/ast/lex.cc"
yy428:
++YYCURSOR;
-#line 629 "../src/ast/lex.re"
+#line 619 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\a'); }
-#line 2704 "src/ast/lex.cc"
+#line 2694 "src/ast/lex.cc"
yy430:
++YYCURSOR;
-#line 630 "../src/ast/lex.re"
+#line 620 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\b'); }
-#line 2709 "src/ast/lex.cc"
+#line 2699 "src/ast/lex.cc"
yy432:
++YYCURSOR;
-#line 631 "../src/ast/lex.re"
+#line 621 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\f'); }
-#line 2714 "src/ast/lex.cc"
+#line 2704 "src/ast/lex.cc"
yy434:
++YYCURSOR;
-#line 632 "../src/ast/lex.re"
+#line 622 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\n'); }
-#line 2719 "src/ast/lex.cc"
+#line 2709 "src/ast/lex.cc"
yy436:
++YYCURSOR;
-#line 633 "../src/ast/lex.re"
+#line 623 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\r'); }
-#line 2724 "src/ast/lex.cc"
+#line 2714 "src/ast/lex.cc"
yy438:
++YYCURSOR;
-#line 634 "../src/ast/lex.re"
+#line 624 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\t'); }
-#line 2729 "src/ast/lex.cc"
+#line 2719 "src/ast/lex.cc"
yy440:
++YYCURSOR;
-#line 635 "../src/ast/lex.re"
+#line 625 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\v'); }
-#line 2734 "src/ast/lex.cc"
+#line 2724 "src/ast/lex.cc"
yy442:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy448:
++YYCURSOR;
-#line 628 "../src/ast/lex.re"
+#line 618 "../src/ast/lex.re"
{ return unesc_oct(tok, cur); }
-#line 2799 "src/ast/lex.cc"
+#line 2789 "src/ast/lex.cc"
yy450:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
}
yy452:
++YYCURSOR;
-#line 627 "../src/ast/lex.re"
+#line 617 "../src/ast/lex.re"
{ return unesc_hex(tok, cur); }
-#line 2828 "src/ast/lex.cc"
+#line 2818 "src/ast/lex.cc"
yy454:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
goto yy444;
}
}
-#line 643 "../src/ast/lex.re"
+#line 633 "../src/ast/lex.re"
}
-const AST *Scanner::lex_str(char quote, bool casing)
+const AST *Scanner::lex_str(char quote)
{
- const AST *r = NULL;
+ const uint32_t column = get_column();
+ std::vector<ASTChar> *str = new std::vector<ASTChar>;
for (bool end;;) {
const uint32_t c = lex_str_chr(quote, end);
- if (end) {
- return r ? r : ast_nil(cline, get_column());
- }
- r = ast_cat(r, casing
- ? ast_ichar(cline, get_column(), c)
- : ast_schar(cline, get_column(), c));
+ if (end) return ast_str(cline, column, str, quote == '\'');
+ str->push_back(ASTChar(c, get_column()));
}
}
sourceline:
tok = cur;
-#line 2875 "src/ast/lex.cc"
+#line 2862 "src/ast/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
yy458:
++YYCURSOR;
yy459:
-#line 688 "../src/ast/lex.re"
+#line 675 "../src/ast/lex.re"
{
goto sourceline;
}
-#line 2928 "src/ast/lex.cc"
+#line 2915 "src/ast/lex.cc"
yy460:
++YYCURSOR;
-#line 676 "../src/ast/lex.re"
+#line 663 "../src/ast/lex.re"
{
if (cur == eof)
{
tok = cur;
return;
}
-#line 2944 "src/ast/lex.cc"
+#line 2931 "src/ast/lex.cc"
yy462:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '\n') goto yy459;
if (yybm[0+yych] & 64) {
goto yy463;
}
-#line 665 "../src/ast/lex.re"
+#line 652 "../src/ast/lex.re"
{
if (!s_to_u32_unsafe (tok, cur, cline))
{
}
goto sourceline;
}
-#line 2964 "src/ast/lex.cc"
+#line 2951 "src/ast/lex.cc"
yy466:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy459;
yy469:
++YYCURSOR;
-#line 672 "../src/ast/lex.re"
+#line 659 "../src/ast/lex.re"
{
escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes
goto sourceline;
}
-#line 2986 "src/ast/lex.cc"
+#line 2973 "src/ast/lex.cc"
yy471:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yych == '\n') goto yy468;
goto yy466;
}
-#line 691 "../src/ast/lex.re"
+#line 678 "../src/ast/lex.re"
}