From 3e8177c0529583c77fdb425685bf064b18a041ee Mon Sep 17 00:00:00 2001 From: helly Date: Sun, 6 May 2007 20:08:43 +0000 Subject: [PATCH] - Make test working --- re2c/test/condition_09.cbif.c | 84 ++++++++++++++++++++-------------- re2c/test/condition_09.cbif.re | 17 +++++-- 2 files changed, 62 insertions(+), 39 deletions(-) diff --git a/re2c/test/condition_09.cbif.c b/re2c/test/condition_09.cbif.c index 4167be8a..93a9d4ac 100755 --- a/re2c/test/condition_09.cbif.c +++ b/re2c/test/condition_09.cbif.c @@ -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; } } diff --git a/re2c/test/condition_09.cbif.re b/re2c/test/condition_09.cbif.re index 7bd5bce3..59b54a77 100755 --- a/re2c/test/condition_09.cbif.re +++ b/re2c/test/condition_09.cbif.re @@ -159,12 +159,12 @@ re2c:condenumprefix = EState; } '"' => String { - fputc(*s->tok, stdout); + fputc(s->cur[-1], stdout); continue; } [^] { - fputc(*s->tok, stdout); + fputc(s->cur[-1], stdout); continue; } "*" "/" => Normal @@ -183,8 +183,15 @@ re2c:condenumprefix = EState; { goto yyc_Skiptoeol; } + "\r" "\n" => Normal + { + fputc('\r', stdout); + fputc('\n', stdout); + continue; + } "\n" => Normal { + fputc('\n', stdout); continue; } [^] @@ -193,17 +200,17 @@ re2c:condenumprefix = EState; } '\\' . { - fputl((const char*)s->tok, 2, stdout); + fputl((const char*)s->cur-2, 2, stdout); continue; } '"' => Normal { - fputc(*s->tok, stdout); + fputc(s->cur[-1], stdout); continue; } [^] { - fputc(*s->tok, stdout); + fputc(s->cur[-1], stdout); continue; } */ -- 2.40.0