From: Ulya Trofimovich Date: Fri, 4 Jan 2019 20:59:25 +0000 (+0000) Subject: Fixed error in range difference with EBCDIC, added tests for various encodings. X-Git-Tag: 1.2~240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6f23fbc72817898f49a961a0dded6811ab2807c;p=re2c Fixed error in range difference with EBCDIC, added tests for various encodings. --- diff --git a/re2c/src/re/ast_to_re.cc b/re2c/src/re/ast_to_re.cc index b0758a55..e0daaa83 100644 --- a/re2c/src/re/ast_to_re.cc +++ b/re2c/src/re/ast_to_re.cc @@ -326,7 +326,11 @@ Range *ast_to_range(const AST *ast, const opt_t *opts) return dot_to_range(ast, opts); case AST::STR: { if (ast->str.chars->size() != 1) break; - const uint32_t c = (*ast->str.chars)[0].chr; + const ASTChar &i = ast->str.chars->front(); + uint32_t c = i.chr; + if (!opts->encoding.encode(c)) { + fatal_lc(ast->line, i.column, "bad code point: '0x%X'", c); + } const bool icase = opts->bCaseInsensitive || (ast->str.icase != opts->bCaseInverted); return icase && is_alpha(c) diff --git a/re2c/test/encodings/diff.i.c b/re2c/test/encodings/diff.i.c new file mode 100644 index 00000000..a5d82182 --- /dev/null +++ b/re2c/test/encodings/diff.i.c @@ -0,0 +1,199 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy10; + default: goto yy8; + } +yy8: + ++YYCURSOR; + {} +yy10: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy16; + default: goto yy14; + } +yy14: + ++YYCURSOR; + {} +yy16: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy22; + default: goto yy20; + } +yy20: + ++YYCURSOR; + {} +yy22: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy28; + default: goto yy26; + } +yy26: + ++YYCURSOR; + {} +yy28: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy34; + default: goto yy32; + } +yy32: + ++YYCURSOR; + {} +yy34: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy40; + default: goto yy38; + } +yy38: + ++YYCURSOR; + {} +yy40: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy46; + default: goto yy44; + } +yy44: + ++YYCURSOR; + {} +yy46: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy52; + default: goto yy50; + } +yy50: + ++YYCURSOR; + {} +yy52: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy58; + default: goto yy56; + } +yy56: + ++YYCURSOR; + {} +yy58: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy64; + default: goto yy62; + } +yy62: + ++YYCURSOR; + {} +yy64: + ++YYCURSOR; + {} +} + diff --git a/re2c/test/encodings/diff.i.re b/re2c/test/encodings/diff.i.re new file mode 100644 index 00000000..47a3894b --- /dev/null +++ b/re2c/test/encodings/diff.i.re @@ -0,0 +1,11 @@ +/*!re2c * {} [\x80-\x82]\[\x81] {} */ +/*!re2c * {} [\x80-\x82]\"\x81" {} */ +/*!re2c * {} [\x80-\x82]\("\x81") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83"|"\x85") {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\[\x81] {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\"\x81" {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x82]\([\x80-\x82]\[\x80\x82]) {} */ +/*!re2c * {} ([\x80-\x82]\[\x81])\[\x81] {} */ +/*!re2c * {} ("\x80"|([\x82-\x83]\("\x83"|"\x85")))\(("\x80"|[\x81\x82])\[\x80\x82]) {} */ diff --git a/re2c/test/encodings/diff.i8.c b/re2c/test/encodings/diff.i8.c new file mode 100644 index 00000000..30692842 --- /dev/null +++ b/re2c/test/encodings/diff.i8.c @@ -0,0 +1,276 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + {} +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy5; + default: goto yy3; + } +yy5: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy11; + default: goto yy9; + } +yy9: + ++YYCURSOR; +yy10: + {} +yy11: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy12; + default: goto yy10; + } +yy12: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy18; + default: goto yy16; + } +yy16: + ++YYCURSOR; +yy17: + {} +yy18: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy19; + default: goto yy17; + } +yy19: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy25; + default: goto yy23; + } +yy23: + ++YYCURSOR; +yy24: + {} +yy25: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy26; + default: goto yy24; + } +yy26: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy32; + default: goto yy30; + } +yy30: + ++YYCURSOR; +yy31: + {} +yy32: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy33; + default: goto yy31; + } +yy33: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy39; + default: goto yy37; + } +yy37: + ++YYCURSOR; +yy38: + {} +yy39: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy40; + default: goto yy38; + } +yy40: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy46; + default: goto yy44; + } +yy44: + ++YYCURSOR; +yy45: + {} +yy46: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy47; + default: goto yy45; + } +yy47: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy53; + default: goto yy51; + } +yy51: + ++YYCURSOR; +yy52: + {} +yy53: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy54; + default: goto yy52; + } +yy54: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy60; + default: goto yy58; + } +yy58: + ++YYCURSOR; +yy59: + {} +yy60: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy61; + default: goto yy59; + } +yy61: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy67; + default: goto yy65; + } +yy65: + ++YYCURSOR; +yy66: + {} +yy67: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy68; + default: goto yy66; + } +yy68: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 0xC2: goto yy74; + default: goto yy72; + } +yy72: + ++YYCURSOR; +yy73: + {} +yy74: + yych = *++YYCURSOR; + switch (yych) { + case 0x80: + case 0x82: goto yy75; + default: goto yy73; + } +yy75: + ++YYCURSOR; + {} +} + diff --git a/re2c/test/encodings/diff.i8.re b/re2c/test/encodings/diff.i8.re new file mode 100644 index 00000000..47a3894b --- /dev/null +++ b/re2c/test/encodings/diff.i8.re @@ -0,0 +1,11 @@ +/*!re2c * {} [\x80-\x82]\[\x81] {} */ +/*!re2c * {} [\x80-\x82]\"\x81" {} */ +/*!re2c * {} [\x80-\x82]\("\x81") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83"|"\x85") {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\[\x81] {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\"\x81" {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x82]\([\x80-\x82]\[\x80\x82]) {} */ +/*!re2c * {} ([\x80-\x82]\[\x81])\[\x81] {} */ +/*!re2c * {} ("\x80"|([\x82-\x83]\("\x83"|"\x85")))\(("\x80"|[\x81\x82])\[\x80\x82]) {} */ diff --git a/re2c/test/encodings/diff.ie.c b/re2c/test/encodings/diff.ie.c new file mode 100644 index 00000000..d938df4d --- /dev/null +++ b/re2c/test/encodings/diff.ie.c @@ -0,0 +1,199 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy10; + default: goto yy8; + } +yy8: + ++YYCURSOR; + {} +yy10: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy16; + default: goto yy14; + } +yy14: + ++YYCURSOR; + {} +yy16: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy22; + default: goto yy20; + } +yy20: + ++YYCURSOR; + {} +yy22: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy28; + default: goto yy26; + } +yy26: + ++YYCURSOR; + {} +yy28: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy34; + default: goto yy32; + } +yy32: + ++YYCURSOR; + {} +yy34: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy40; + default: goto yy38; + } +yy38: + ++YYCURSOR; + {} +yy40: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy46; + default: goto yy44; + } +yy44: + ++YYCURSOR; + {} +yy46: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy52; + default: goto yy50; + } +yy50: + ++YYCURSOR; + {} +yy52: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy58; + default: goto yy56; + } +yy56: + ++YYCURSOR; + {} +yy58: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 0x20: + case 0x22: goto yy64; + default: goto yy62; + } +yy62: + ++YYCURSOR; + {} +yy64: + ++YYCURSOR; + {} +} + diff --git a/re2c/test/encodings/diff.ie.re b/re2c/test/encodings/diff.ie.re new file mode 100644 index 00000000..47a3894b --- /dev/null +++ b/re2c/test/encodings/diff.ie.re @@ -0,0 +1,11 @@ +/*!re2c * {} [\x80-\x82]\[\x81] {} */ +/*!re2c * {} [\x80-\x82]\"\x81" {} */ +/*!re2c * {} [\x80-\x82]\("\x81") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83"|"\x85") {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\[\x81] {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\"\x81" {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x82]\([\x80-\x82]\[\x80\x82]) {} */ +/*!re2c * {} ([\x80-\x82]\[\x81])\[\x81] {} */ +/*!re2c * {} ("\x80"|([\x82-\x83]\("\x83"|"\x85")))\(("\x80"|[\x81\x82])\[\x80\x82]) {} */ diff --git a/re2c/test/encodings/diff.iu.c b/re2c/test/encodings/diff.iu.c new file mode 100644 index 00000000..cb83b9b9 --- /dev/null +++ b/re2c/test/encodings/diff.iu.c @@ -0,0 +1,155 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy4; + if (yych == 0x00000082) goto yy4; + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy10; + if (yych == 0x00000082) goto yy10; + ++YYCURSOR; + {} +yy10: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy16; + if (yych == 0x00000082) goto yy16; + ++YYCURSOR; + {} +yy16: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy22; + if (yych == 0x00000082) goto yy22; + ++YYCURSOR; + {} +yy22: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy28; + if (yych == 0x00000082) goto yy28; + ++YYCURSOR; + {} +yy28: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy34; + if (yych == 0x00000082) goto yy34; + ++YYCURSOR; + {} +yy34: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy40; + if (yych == 0x00000082) goto yy40; + ++YYCURSOR; + {} +yy40: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy46; + if (yych == 0x00000082) goto yy46; + ++YYCURSOR; + {} +yy46: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy52; + if (yych == 0x00000082) goto yy52; + ++YYCURSOR; + {} +yy52: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy58; + if (yych == 0x00000082) goto yy58; + ++YYCURSOR; + {} +yy58: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x00000080) goto yy64; + if (yych == 0x00000082) goto yy64; + ++YYCURSOR; + {} +yy64: + ++YYCURSOR; + {} +} + diff --git a/re2c/test/encodings/diff.iu.re b/re2c/test/encodings/diff.iu.re new file mode 100644 index 00000000..47a3894b --- /dev/null +++ b/re2c/test/encodings/diff.iu.re @@ -0,0 +1,11 @@ +/*!re2c * {} [\x80-\x82]\[\x81] {} */ +/*!re2c * {} [\x80-\x82]\"\x81" {} */ +/*!re2c * {} [\x80-\x82]\("\x81") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83"|"\x85") {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\[\x81] {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\"\x81" {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x82]\([\x80-\x82]\[\x80\x82]) {} */ +/*!re2c * {} ([\x80-\x82]\[\x81])\[\x81] {} */ +/*!re2c * {} ("\x80"|([\x82-\x83]\("\x83"|"\x85")))\(("\x80"|[\x81\x82])\[\x80\x82]) {} */ diff --git a/re2c/test/encodings/diff.iw.c b/re2c/test/encodings/diff.iw.c new file mode 100644 index 00000000..33e54bf3 --- /dev/null +++ b/re2c/test/encodings/diff.iw.c @@ -0,0 +1,155 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy4; + if (yych == 0x0082) goto yy4; + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy10; + if (yych == 0x0082) goto yy10; + ++YYCURSOR; + {} +yy10: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy16; + if (yych == 0x0082) goto yy16; + ++YYCURSOR; + {} +yy16: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy22; + if (yych == 0x0082) goto yy22; + ++YYCURSOR; + {} +yy22: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy28; + if (yych == 0x0082) goto yy28; + ++YYCURSOR; + {} +yy28: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy34; + if (yych == 0x0082) goto yy34; + ++YYCURSOR; + {} +yy34: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy40; + if (yych == 0x0082) goto yy40; + ++YYCURSOR; + {} +yy40: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy46; + if (yych == 0x0082) goto yy46; + ++YYCURSOR; + {} +yy46: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy52; + if (yych == 0x0082) goto yy52; + ++YYCURSOR; + {} +yy52: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy58; + if (yych == 0x0082) goto yy58; + ++YYCURSOR; + {} +yy58: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy64; + if (yych == 0x0082) goto yy64; + ++YYCURSOR; + {} +yy64: + ++YYCURSOR; + {} +} + diff --git a/re2c/test/encodings/diff.iw.re b/re2c/test/encodings/diff.iw.re new file mode 100644 index 00000000..47a3894b --- /dev/null +++ b/re2c/test/encodings/diff.iw.re @@ -0,0 +1,11 @@ +/*!re2c * {} [\x80-\x82]\[\x81] {} */ +/*!re2c * {} [\x80-\x82]\"\x81" {} */ +/*!re2c * {} [\x80-\x82]\("\x81") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83"|"\x85") {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\[\x81] {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\"\x81" {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x82]\([\x80-\x82]\[\x80\x82]) {} */ +/*!re2c * {} ([\x80-\x82]\[\x81])\[\x81] {} */ +/*!re2c * {} ("\x80"|([\x82-\x83]\("\x83"|"\x85")))\(("\x80"|[\x81\x82])\[\x80\x82]) {} */ diff --git a/re2c/test/encodings/diff.ix.c b/re2c/test/encodings/diff.ix.c new file mode 100644 index 00000000..33e54bf3 --- /dev/null +++ b/re2c/test/encodings/diff.ix.c @@ -0,0 +1,155 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy4; + if (yych == 0x0082) goto yy4; + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy10; + if (yych == 0x0082) goto yy10; + ++YYCURSOR; + {} +yy10: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy16; + if (yych == 0x0082) goto yy16; + ++YYCURSOR; + {} +yy16: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy22; + if (yych == 0x0082) goto yy22; + ++YYCURSOR; + {} +yy22: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy28; + if (yych == 0x0082) goto yy28; + ++YYCURSOR; + {} +yy28: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy34; + if (yych == 0x0082) goto yy34; + ++YYCURSOR; + {} +yy34: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy40; + if (yych == 0x0082) goto yy40; + ++YYCURSOR; + {} +yy40: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy46; + if (yych == 0x0082) goto yy46; + ++YYCURSOR; + {} +yy46: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy52; + if (yych == 0x0082) goto yy52; + ++YYCURSOR; + {} +yy52: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy58; + if (yych == 0x0082) goto yy58; + ++YYCURSOR; + {} +yy58: + ++YYCURSOR; + {} +} + + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == 0x0080) goto yy64; + if (yych == 0x0082) goto yy64; + ++YYCURSOR; + {} +yy64: + ++YYCURSOR; + {} +} + diff --git a/re2c/test/encodings/diff.ix.re b/re2c/test/encodings/diff.ix.re new file mode 100644 index 00000000..47a3894b --- /dev/null +++ b/re2c/test/encodings/diff.ix.re @@ -0,0 +1,11 @@ +/*!re2c * {} [\x80-\x82]\[\x81] {} */ +/*!re2c * {} [\x80-\x82]\"\x81" {} */ +/*!re2c * {} [\x80-\x82]\("\x81") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x83]\("\x81"|"\x83"|"\x85") {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\[\x81] {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\"\x81" {} */ +/*!re2c * {} ("\x80"|"\x81"|"\x82")\("\x81"|"\x83") {} */ +/*!re2c * {} [\x80-\x82]\([\x80-\x82]\[\x80\x82]) {} */ +/*!re2c * {} ([\x80-\x82]\[\x81])\[\x81] {} */ +/*!re2c * {} ("\x80"|([\x82-\x83]\("\x83"|"\x85")))\(("\x80"|[\x81\x82])\[\x80\x82]) {} */