summaryrefslogtreecommitdiff
path: root/ext/syck/token.c
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-05 04:43:05 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-05 04:43:05 +0000
commit017d4ff10ae32ed6570b5d33a8106bd1f22e008f (patch)
treec0485110aa5ea341f821cb6bfa210041b71813e3 /ext/syck/token.c
parent45c7ea552d0293aa217bbb496d4238754ba701d2 (diff)
* ext/syck/token.c: directives choked on a period.
* ext/syck/gram.y: anchors work above a collection. [ruby-core:1071] * ext/syck/handler.c, ext/syck/syck.c: ensure a fresh strtable between parser iterations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/token.c')
-rw-r--r--ext/syck/token.c200
1 files changed, 129 insertions, 71 deletions
diff --git a/ext/syck/token.c b/ext/syck/token.c
index 01e51bad0ff..b176f755dd5 100644
--- a/ext/syck/token.c
+++ b/ext/syck/token.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.5 on Fri May 30 15:54:17 2003 */
+/* Generated by re2c 0.5 on Mon Jun 2 23:45:51 2003 */
#line 1 "token.re"
/*
* token.re
@@ -226,7 +226,7 @@ yylex( YYSTYPE *yylval, SyckParser *parser )
return t;
}
-#line 243
+#line 244
if ( YYLINEPTR != YYCURSOR )
@@ -260,19 +260,19 @@ yy2: yyaccept = 0;
default: goto yy3;
}
yy3:
-#line 284
+#line 285
{ YYPOS(0);
goto Document;
}
yy4: yych = *++YYCURSOR;
yy5:
-#line 270
+#line 271
{ eat_comments( parser );
goto Header;
}
yy6: yych = *++YYCURSOR;
yy7:
-#line 274
+#line 275
{ SyckLevel *lvl = CURRENT_LEVEL();
ENSURE_IEND(lvl, -1);
return 0;
@@ -280,7 +280,7 @@ yy7:
yy8: yych = *++YYCURSOR;
goto yy12;
yy9:
-#line 279
+#line 280
{ int indt_len;
GOBBLE_UP_INDENT( indt_len, YYTOKEN );
goto Header;
@@ -325,7 +325,7 @@ yy19: switch(yych){
default: goto yy20;
}
yy20:
-#line 256
+#line 257
{ SyckLevel *lvl = CURRENT_LEVEL();
if ( lvl->status == syck_lvl_header )
{
@@ -347,7 +347,7 @@ yy22: switch(yych){
default: goto yy20;
}
}
-#line 288
+#line 289
Document:
@@ -388,7 +388,7 @@ yy23:
yy25: yych = *++YYCURSOR;
goto yy77;
yy26:
-#line 302
+#line 303
{ // Isolate spaces
int indt_len;
GOBBLE_UP_INDENT( indt_len, YYTOKEN );
@@ -405,7 +405,7 @@ yy26:
}
yy27: yych = *++YYCURSOR;
yy28:
-#line 317
+#line 318
{ ENSURE_IOPEN(lvl, 0, 1);
lvl = CURRENT_LEVEL();
ADD_LEVEL(lvl->spaces + 1, syck_lvl_inline);
@@ -413,7 +413,7 @@ yy28:
}
yy29: yych = *++YYCURSOR;
yy30:
-#line 323
+#line 324
{ POP_LEVEL();
return YYTOKEN[0];
}
@@ -424,7 +424,7 @@ yy31: yych = *++YYCURSOR;
default: goto yy32;
}
yy32:
-#line 381
+#line 382
{ ENSURE_IOPEN(lvl, 0, 1);
goto Plain;
}
@@ -564,17 +564,17 @@ yy35: yych = *++YYCURSOR;
}
yy36: yych = *++YYCURSOR;
yy37:
-#line 355
+#line 356
{ ENSURE_IOPEN(lvl, 0, 1);
goto TransferMethod; }
yy38: yych = *++YYCURSOR;
yy39:
-#line 358
+#line 359
{ ENSURE_IOPEN(lvl, 0, 1);
goto SingleQuote; }
yy40: yych = *++YYCURSOR;
yy41:
-#line 361
+#line 362
{ ENSURE_IOPEN(lvl, 0, 1);
goto DoubleQuote; }
yy42: yyaccept = 0;
@@ -596,18 +596,18 @@ yy42: yyaccept = 0;
}
yy43: yych = *++YYCURSOR;
yy44:
-#line 371
+#line 372
{ eat_comments( parser );
goto Document;
}
yy45: yych = *++YYCURSOR;
goto yy51;
yy46:
-#line 375
+#line 376
{ goto Document; }
yy47: yych = *++YYCURSOR;
yy48:
-#line 377
+#line 378
{ ENSURE_IEND(lvl, -1);
return 0;
}
@@ -650,7 +650,7 @@ yy56: switch(yych){
default: goto yy57;
}
yy57:
-#line 364
+#line 365
{ if ( *( YYCURSOR - 1 ) == '\n' )
{
YYCURSOR--;
@@ -731,7 +731,7 @@ yy61: switch(yych){
default: goto yy62;
}
yy62:
-#line 350
+#line 351
{ ENSURE_IOPEN(lvl, 0, 1);
yylval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
return ALIAS;
@@ -803,7 +803,7 @@ yy64: switch(yych){
default: goto yy65;
}
yy65:
-#line 345
+#line 346
{ ENSURE_IOPEN(lvl, 0, 1);
yylval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
return ANCHOR;
@@ -816,7 +816,7 @@ yy67: switch(yych){
default: goto yy68;
}
yy68:
-#line 331
+#line 332
{ ENSURE_IOPEN(lvl, YYTOKEN - YYLINEPTR, 1);
FORCE_NEXT_TOKEN(IOPEN);
if ( *YYCURSOR == '\n' || *( YYCURSOR - 1 ) == '\n' )
@@ -845,7 +845,7 @@ yy72: switch(yych){
default: goto yy73;
}
yy73:
-#line 327
+#line 328
{ YYPOS(1);
return YYTOKEN[0];
}
@@ -872,7 +872,7 @@ yy79: switch(yych){
default: goto yy26;
}
}
-#line 385
+#line 386
}
@@ -901,7 +901,9 @@ yy82: YYCURSOR = YYMARKER;
yy83: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
- case '-': case '0':
+ case '.':
+ case '/':
+ case '0':
case '1':
case '2':
case '3':
@@ -910,7 +912,15 @@ yy83: yyaccept = 0;
case '6':
case '7':
case '8':
- case '9': case 'A':
+ case '9':
+ case ':':
+ case ';':
+ case '<':
+ case '=':
+ case '>':
+ case '?':
+ case '@':
+ case 'A':
case 'B':
case 'C':
case 'D':
@@ -935,7 +945,12 @@ yy83: yyaccept = 0;
case 'W':
case 'X':
case 'Y':
- case 'Z': case '_': case 'a':
+ case 'Z':
+ case '[':
+ case '\\':
+ case ']':
+ case '^':
+ case '_': case 'a':
case 'b':
case 'c':
case 'd':
@@ -964,14 +979,14 @@ yy83: yyaccept = 0;
default: goto yy84;
}
yy84:
-#line 398
+#line 399
{ YYCURSOR = YYTOKTMP;
return DOCSEP;
}
yy85: yych = *++YYCURSOR;
goto yy89;
yy86:
-#line 396
+#line 397
{ goto Directive; }
yy87: yych = *++YYCURSOR;
goto yy84;
@@ -986,7 +1001,9 @@ yy90: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy91: switch(yych){
- case '-': case '0':
+ case '.':
+ case '/':
+ case '0':
case '1':
case '2':
case '3':
@@ -995,7 +1012,13 @@ yy91: switch(yych){
case '6':
case '7':
case '8':
- case '9': case 'A':
+ case '9': case ';':
+ case '<':
+ case '=':
+ case '>':
+ case '?':
+ case '@':
+ case 'A':
case 'B':
case 'C':
case 'D':
@@ -1020,7 +1043,12 @@ yy91: switch(yych){
case 'W':
case 'X':
case 'Y':
- case 'Z': case '_': case 'a':
+ case 'Z':
+ case '[':
+ case '\\':
+ case ']':
+ case '^':
+ case '_': case 'a':
case 'b':
case 'c':
case 'd':
@@ -1051,7 +1079,9 @@ yy91: switch(yych){
}
yy92: yych = *++YYCURSOR;
switch(yych){
- case '-': case '0':
+ case '.':
+ case '/':
+ case '0':
case '1':
case '2':
case '3':
@@ -1060,7 +1090,15 @@ yy92: yych = *++YYCURSOR;
case '6':
case '7':
case '8':
- case '9': case 'A':
+ case '9':
+ case ':':
+ case ';':
+ case '<':
+ case '=':
+ case '>':
+ case '?':
+ case '@':
+ case 'A':
case 'B':
case 'C':
case 'D':
@@ -1085,7 +1123,12 @@ yy92: yych = *++YYCURSOR;
case 'W':
case 'X':
case 'Y':
- case 'Z': case '_': case 'a':
+ case 'Z':
+ case '[':
+ case '\\':
+ case ']':
+ case '^':
+ case '_': case 'a':
case 'b':
case 'c':
case 'd':
@@ -1117,7 +1160,9 @@ yy93: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy94: switch(yych){
- case '-': case '0':
+ case '.':
+ case '/':
+ case '0':
case '1':
case '2':
case '3':
@@ -1126,7 +1171,15 @@ yy94: switch(yych){
case '6':
case '7':
case '8':
- case '9': case 'A':
+ case '9':
+ case ':':
+ case ';':
+ case '<':
+ case '=':
+ case '>':
+ case '?':
+ case '@':
+ case 'A':
case 'B':
case 'C':
case 'D':
@@ -1151,7 +1204,12 @@ yy94: switch(yych){
case 'W':
case 'X':
case 'Y':
- case 'Z': case '_': case 'a':
+ case 'Z':
+ case '[':
+ case '\\':
+ case ']':
+ case '^':
+ case '_': case 'a':
case 'b':
case 'c':
case 'd':
@@ -1180,10 +1238,10 @@ yy94: switch(yych){
default: goto yy95;
}
yy95:
-#line 394
+#line 395
{ goto Directive; }
}
-#line 401
+#line 402
}
@@ -1225,7 +1283,7 @@ yy96:
yy98: yych = *++YYCURSOR;
goto yy122;
yy99:
-#line 424
+#line 425
{ int indt_len, nl_count = 0;
SyckLevel *lvl;
char *tok = YYTOKTMP;
@@ -1264,13 +1322,13 @@ yy100: yych = *++YYCURSOR;
default: goto yy101;
}
yy101:
-#line 475
+#line 476
{ QUOTECATS(qstr, qcapa, qidx, YYTOKTMP, YYCURSOR - YYTOKTMP);
goto Plain2;
}
yy102: yych = *++YYCURSOR;
yy103:
-#line 458
+#line 459
{ if ( plvl->status != syck_lvl_inline )
{
YYCURSOR--;
@@ -1291,17 +1349,17 @@ yy105: yych = *++YYCURSOR;
default: goto yy106;
}
yy106:
-#line 473
+#line 474
{ goto Plain3; }
yy107: yych = *++YYCURSOR;
yy108:
-#line 471
+#line 472
{ RETURN_IMPLICIT(); }
yy109: yych = *++YYCURSOR;
goto yy101;
yy110: yych = *++YYCURSOR;
yy111:
-#line 467
+#line 468
{ eat_comments( parser );
RETURN_IMPLICIT();
}
@@ -1327,7 +1385,7 @@ yy117: switch(yych){
default: goto yy118;
}
yy118:
-#line 456
+#line 457
{ RETURN_IMPLICIT(); }
yy119: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -1352,7 +1410,7 @@ yy124: switch(yych){
default: goto yy99;
}
}
-#line 479
+#line 480
}
@@ -1382,7 +1440,7 @@ yy125:
yy127: yych = *++YYCURSOR;
goto yy137;
yy128:
-#line 493
+#line 494
{ int indt_len;
int nl_count = 0;
SyckLevel *lvl;
@@ -1424,7 +1482,7 @@ yy129: yych = *++YYCURSOR;
default: goto yy130;
}
yy130:
-#line 533
+#line 534
{ SyckLevel *lvl;
SyckNode *n = syck_alloc_str();
lvl = CURRENT_LEVEL();
@@ -1442,13 +1500,13 @@ yy131: yych = *++YYCURSOR;
goto yy130;
yy132: yych = *++YYCURSOR;
yy133:
-#line 547
+#line 548
{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
goto SingleQuote2;
}
yy134: yych = *++YYCURSOR;
yy135:
-#line 529
+#line 530
{ QUOTECAT(qstr, qcapa, qidx, '\'');
goto SingleQuote2;
}
@@ -1468,7 +1526,7 @@ yy139: switch(yych){
default: goto yy128;
}
}
-#line 551
+#line 552
}
@@ -1503,7 +1561,7 @@ yy140:
yy142: yych = *++YYCURSOR;
goto yy162;
yy143:
-#line 569
+#line 570
{ int indt_len;
int nl_count = 0;
SyckLevel *lvl;
@@ -1555,13 +1613,13 @@ yy144: yyaccept = 0;
default: goto yy145;
}
yy145:
-#line 653
+#line 654
{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
goto DoubleQuote2;
}
yy146: yych = *++YYCURSOR;
yy147:
-#line 639
+#line 640
{ SyckLevel *lvl;
SyckNode *n = syck_alloc_str();
lvl = CURRENT_LEVEL();
@@ -1593,7 +1651,7 @@ yy152: YYCURSOR = YYMARKER;
}
yy153: yych = *++YYCURSOR;
yy154:
-#line 634
+#line 635
{ keep_nl = 0;
YYCURSOR--;
goto DoubleQuote2;
@@ -1624,7 +1682,7 @@ yy155: yych = *++YYCURSOR;
}
yy156: yych = *++YYCURSOR;
yy157:
-#line 609
+#line 610
{ char ch = *( YYCURSOR - 1 );
switch ( ch )
{
@@ -1666,7 +1724,7 @@ yy158: yych = *++YYCURSOR;
}
yy159: yych = *++YYCURSOR;
yy160:
-#line 625
+#line 626
{ long ch;
char *chr_text = syck_strndup( YYTOKTMP, 4 );
chr_text[0] = '0';
@@ -1691,7 +1749,7 @@ yy164: switch(yych){
default: goto yy143;
}
}
-#line 657
+#line 658
}
@@ -1716,7 +1774,7 @@ yy165:
yy167:yy168: yych = *++YYCURSOR;
goto yy176;
yy169:
-#line 666
+#line 667
{ SyckLevel *lvl;
YYCURSOR = YYTOKTMP;
if ( YYCURSOR == YYTOKEN + 1 )
@@ -1766,7 +1824,7 @@ yy170: yych = *++YYCURSOR;
goto yy174;
yy171: yych = *++YYCURSOR;
yy172:
-#line 712
+#line 713
{ goto TransferMethod; }
yy173: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -1783,7 +1841,7 @@ yy176: switch(yych){
default: goto yy169;
}
}
-#line 714
+#line 715
}
@@ -1847,7 +1905,7 @@ yy177:
yy179: yych = *++YYCURSOR;
goto yy188;
yy180:
-#line 762
+#line 763
{ char *pacer;
char *tok = YYTOKTMP;
int indt_len = 0, nl_count = 0, fold_nl = 0;
@@ -1917,7 +1975,7 @@ yy180:
}
yy181: yych = *++YYCURSOR;
yy182:
-#line 831
+#line 832
{ lvl = CURRENT_LEVEL();
if ( lvl->status != syck_lvl_block )
{
@@ -1932,14 +1990,14 @@ yy182:
}
yy183: yych = *++YYCURSOR;
yy184:
-#line 845
+#line 846
{ YYCURSOR--;
POP_LEVEL();
RETURN_BLOCK();
}
yy185: yych = *++YYCURSOR;
yy186:
-#line 850
+#line 851
{ QUOTECAT(qstr, qcapa, qidx, *YYTOKTMP);
goto ScalarBlock2;
}
@@ -1959,7 +2017,7 @@ yy190: switch(yych){
default: goto yy180;
}
}
-#line 855
+#line 856
}
@@ -1989,7 +2047,7 @@ yy191:
}
yy193: yych = *++YYCURSOR;
yy194:
-#line 871
+#line 872
{ SyckLevel *lvl = CURRENT_LEVEL();
YYCURSOR = tok;
return;
@@ -1998,7 +2056,7 @@ yy195: yych = *++YYCURSOR;
goto yy199;
yy196: yych = *++YYCURSOR;
yy197:
-#line 876
+#line 877
{ goto Comment;
}
yy198: ++YYCURSOR;
@@ -2009,7 +2067,7 @@ yy199: switch(yych){
default: goto yy194;
}
}
-#line 879
+#line 880
}