]> granicus.if.org Git - re2c/commitdiff
- Make test working
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 6 May 2007 20:08:43 +0000 (20:08 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 6 May 2007 20:08:43 +0000 (20:08 +0000)
re2c/test/condition_09.cbif.c
re2c/test/condition_09.cbif.re

index 4167be8af8509b2ee7a8b7b3e9801ae0ce9a97c8..93a9d4aca90ddb75c7dd8009902a9952e313c5d5 100755 (executable)
@@ -150,7 +150,7 @@ yyFillLabel1:
                        if(s->yych == '?') goto yy26;
 yy10:
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
 yy11:
@@ -167,7 +167,7 @@ yy13:
                        ++s->cur;
                        s->cond = EStateString;
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
 yy15:
@@ -276,55 +276,71 @@ yyc_Skiptoeol:
                        if((s->lim - s->cur) < 5) if(fill(s, 5) == ~0) break;
 yyFillLabel2:
                        s->yych = *s->cur;
-                       if(s->yych <= '>') {
-                               if(s->yych == 0x0A) goto yy50;
-                               goto yy52;
+                       if(s->yych <= 0x0D) {
+                               if(s->yych == 0x0A) goto yy51;
+                               if(s->yych <= 0x0C) goto yy53;
+                               goto yy50;
                        } else {
-                               if(s->yych <= '?') goto yy47;
-                               if(s->yych == '\\') goto yy49;
-                               goto yy52;
+                               if(s->yych <= '?') {
+                                       if(s->yych <= '>') goto yy53;
+                               } else {
+                                       if(s->yych == '\\') goto yy49;
+                                       goto yy53;
+                               }
                        }
-yy47:
                        s->yych = *(s->tok = ++s->cur);
-                       if(s->yych == '?') goto yy57;
+                       if(s->yych == '?') goto yy60;
 yy48:
                        {
                                goto yyc_Skiptoeol;
                        }
 yy49:
                        s->yych = *(s->tok = ++s->cur);
-                       if(s->yych == 0x0A) goto yy55;
-                       if(s->yych == 0x0D) goto yy53;
+                       if(s->yych == 0x0A) goto yy58;
+                       if(s->yych == 0x0D) goto yy56;
                        goto yy48;
 yy50:
+                       s->yych = *++s->cur;
+                       if(s->yych == 0x0A) goto yy54;
+                       goto yy48;
+yy51:
                        ++s->cur;
                        s->cond = EStateNormal;
                        {
+                               fputc('\n', stdout);
                                continue;
                        }
-yy52:
-                       s->yych = *++s->cur;
-                       goto yy48;
 yy53:
                        s->yych = *++s->cur;
-                       if(s->yych == 0x0A) goto yy55;
+                       goto yy48;
 yy54:
+                       ++s->cur;
+                       s->cond = EStateNormal;
+                       {
+                               fputc('\r', stdout);
+                               fputc('\n', stdout);
+                               continue;
+                       }
+yy56:
+                       s->yych = *++s->cur;
+                       if(s->yych == 0x0A) goto yy58;
+yy57:
                        s->cur = s->tok;
                        goto yy48;
-yy55:
+yy58:
                        ++s->cur;
                        {
                                goto yyc_Skiptoeol;
                        }
-yy57:
+yy60:
                        s->yych = *++s->cur;
-                       if(s->yych != '/') goto yy54;
+                       if(s->yych != '/') goto yy57;
                        s->yych = *++s->cur;
-                       if(s->yych == 0x0A) goto yy60;
-                       if(s->yych != 0x0D) goto yy54;
+                       if(s->yych == 0x0A) goto yy63;
+                       if(s->yych != 0x0D) goto yy57;
                        s->yych = *++s->cur;
-                       if(s->yych != 0x0A) goto yy54;
-yy60:
+                       if(s->yych != 0x0A) goto yy57;
+yy63:
                        ++s->cur;
                        {
                                goto yyc_Skiptoeol;
@@ -335,29 +351,29 @@ yyc_String:
                        if((s->lim - s->cur) < 2) if(fill(s, 2) == ~0) break;
 yyFillLabel3:
                        s->yych = *s->cur;
-                       if(s->yych == '"') goto yy66;
-                       if(s->yych != '\\') goto yy68;
+                       if(s->yych == '"') goto yy69;
+                       if(s->yych != '\\') goto yy71;
                        ++s->cur;
-                       if((s->yych = *s->cur) != 0x0A) goto yy69;
-yy65:
+                       if((s->yych = *s->cur) != 0x0A) goto yy72;
+yy68:
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
-yy66:
+yy69:
                        ++s->cur;
                        s->cond = EStateNormal;
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
-yy68:
+yy71:
                        s->yych = *++s->cur;
-                       goto yy65;
-yy69:
+                       goto yy68;
+yy72:
                        ++s->cur;
                        {
-                               fputl((const char*)s->tok, 2, stdout);
+                               fputl((const char*)s->cur-2, 2, stdout);
                                continue;
                        }
                }
index 7bd5bce3b01d519030c3afd6d0cacdd2cd76ccc2..59b54a77ba0db2042cd45fc4362db53e49cc9172 100755 (executable)
@@ -159,12 +159,12 @@ re2c:condenumprefix          = EState;
                        }
 <Normal>       '"' => String
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
 <Normal>       [^]
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
 <Comment>      "*" "/" => Normal
@@ -183,8 +183,15 @@ re2c:condenumprefix          = EState;
                        {
                                goto yyc_Skiptoeol;
                        }
+<Skiptoeol>    "\r" "\n" => Normal
+                       {
+                               fputc('\r', stdout);
+                               fputc('\n', stdout);
+                               continue;
+                       }
 <Skiptoeol>    "\n" => Normal
                        {
+                               fputc('\n', stdout);
                                continue;
                        }
 <Skiptoeol> [^]
@@ -193,17 +200,17 @@ re2c:condenumprefix          = EState;
                        }
 <String>       '\\' .
                        {
-                               fputl((const char*)s->tok, 2, stdout);
+                               fputl((const char*)s->cur-2, 2, stdout);
                                continue;
                        }
 <String>       '"' => Normal
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
 <String>       [^]
                        {
-                               fputc(*s->tok, stdout);
+                               fputc(s->cur[-1], stdout);
                                continue;
                        }
 */