Permalink
Browse files

allow empty lines in block string literals

  • Loading branch information...
shinh authored and indeyets committed Jan 16, 2010
1 parent cd8e7ab commit b522b7f8646509198ea29bc392eb70d5704bd515
Showing with 50 additions and 40 deletions.
  1. +48 −38 lib/token.c
  2. +2 −2 lib/token.re
View
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Tue Nov 18 20:30:04 2008 */
+/* Generated by re2c 0.13.5 on Sat Jan 16 23:23:24 2010 */
/*
* token.re
*
@@ -203,7 +203,7 @@
syckerror("TAB found in your indentation, please remove"); \
return 0; \
} \
- else if ( is_newline( ++indent ) ) \
+ else if ( is_newline( indent++ ) ) \
{ \
NEWLINE(indent); \
} \
@@ -2437,7 +2437,11 @@ sycklex_yaml_utf8( YYSTYPE *sycklval, SyckParser *parser )
yy217:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy236;
+ switch (yych) {
+ case '\n': goto yy235;
+ case '\r': goto yy241;
+ default: goto yy238;
+ }
yy218:
{ char *pacer;
char *tok = YYTOKEN;
@@ -2613,31 +2617,37 @@ sycklex_yaml_utf8( YYSTYPE *sycklval, SyckParser *parser )
YYMARKER = ++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
-yy236:
switch (yych) {
- case '\t': goto yy235;
- case '\n':
- case ' ': goto yy237;
- case '\r': goto yy239;
+ case '\t': goto yy237;
+ case '\n': goto yy235;
+ case '\r': goto yy241;
+ case ' ': goto yy239;
default: goto yy218;
}
yy237:
- yyaccept = 0;
- YYMARKER = ++YYCURSOR;
+ ++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
+yy238:
switch (yych) {
- case '\n':
- case ' ': goto yy237;
- case '\r': goto yy239;
+ case '\t': goto yy237;
+ case ' ': goto yy239;
default: goto yy218;
}
yy239:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
- case '\n': goto yy237;
+ case ' ': goto yy239;
+ default: goto yy218;
+ }
+yy241:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\n': goto yy235;
default: goto yy228;
}
}
@@ -2661,53 +2671,53 @@ eat_comments( SyckParser *parser )
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
switch (yych) {
- case 0x00: goto yy242;
- case '\n': goto yy244;
- case '\r': goto yy245;
- default: goto yy247;
+ case 0x00: goto yy244;
+ case '\n': goto yy246;
+ case '\r': goto yy247;
+ default: goto yy249;
}
-yy242:
+yy244:
++YYCURSOR;
-yy243:
+yy245:
{ YYCURSOR = YYTOKEN;
return;
}
-yy244:
+yy246:
yych = *(YYMARKER = ++YYCURSOR);
- goto yy249;
-yy245:
+ goto yy251;
+yy247:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case '\n': goto yy248;
- default: goto yy246;
+ case '\n': goto yy250;
+ default: goto yy248;
}
-yy246:
+yy248:
{ goto Comment;
}
-yy247:
+yy249:
yych = *++YYCURSOR;
- goto yy246;
-yy248:
+ goto yy248;
+yy250:
YYMARKER = ++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
-yy249:
+yy251:
switch (yych) {
- case '\n': goto yy248;
- case '\r': goto yy250;
- default: goto yy243;
+ case '\n': goto yy250;
+ case '\r': goto yy252;
+ default: goto yy245;
}
-yy250:
+yy252:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
- case '\n': goto yy248;
- default: goto yy251;
+ case '\n': goto yy250;
+ default: goto yy253;
}
-yy251:
+yy253:
YYCURSOR = YYMARKER;
- goto yy243;
+ goto yy245;
}
View
@@ -202,7 +202,7 @@
syckerror("TAB found in your indentation, please remove"); \
return 0; \
} \
- else if ( is_newline( ++indent ) ) \
+ else if ( is_newline( indent++ ) ) \
{ \
NEWLINE(indent); \
} \
@@ -966,7 +966,7 @@ ScalarBlock2:
/*!re2c
-YINDENT { char *pacer;
+LF+ TAB* SPC* { char *pacer;
char *tok = YYTOKEN;
int indt_len = 0, nl_count = 0, fold_nl = 0, nl_begin = 0;
GOBBLE_UP_YAML_INDENT( indt_len, tok );

0 comments on commit b522b7f

Please sign in to comment.