]> granicus.if.org Git - re2c/commitdiff
- Do not translate config values
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 17 Nov 2008 18:47:17 +0000 (18:47 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 17 Nov 2008 18:47:17 +0000 (18:47 +0000)
re2c/code.cc
re2c/test/config11.ei.c [new file with mode: 0755]
re2c/test/config11.ei.re [new file with mode: 0755]

index a64889a08bc1082595094d0447e4396c040d4acc..f239f8b9230f160fafd026df6573282f62dcee9c 100644 (file)
@@ -2296,7 +2296,15 @@ void Scanner::config(const Str& cfg, const Str& val)
        && (val.str[0] == '"' || val.str[0] == '\''))
        {
                SubStr tmp(val.str + 1, val.len - 2);
+               if (eFlag) {
+                       re2c::xlat = asc2asc;
+                       re2c::talx = asc2asc;
+               }
                unescape(tmp, strVal);
+               if (eFlag) {
+                       re2c::xlat = asc2ebc;
+                       re2c::talx = ebc2asc;
+               }
        }
        else
        {
diff --git a/re2c/test/config11.ei.c b/re2c/test/config11.ei.c
new file mode 100755 (executable)
index 0000000..9f0e26f
--- /dev/null
@@ -0,0 +1,25 @@
+/* Generated by re2c */
+unsigned char scan(const unsigned char *s)
+{
+       unsigned char* cr;
+       unsigned char  ch;
+
+{
+       unsigned char ch;
+
+       ch = *cr;
+       switch (ch) {
+       case 'a':       goto yy3;
+       case 'b':       goto yy5;
+       default:        goto yy2;
+       }
+yy2:
+yy3:
+       ++cr;
+       return 'a';
+yy5:
+       ++cr;
+       return 'b';
+}
+
+}
diff --git a/re2c/test/config11.ei.re b/re2c/test/config11.ei.re
new file mode 100755 (executable)
index 0000000..0f7f2af
--- /dev/null
@@ -0,0 +1,17 @@
+unsigned char scan(const unsigned char *s)
+{
+       unsigned char* cr;
+       unsigned char  ch;
+/*!re2c
+
+re2c:define:YYCTYPE     = "unsigned char";
+re2c:define:YYCURSOR    = cr;
+re2c:define:YYFILL      = fill;
+re2c:variable:yych      = ch;
+re2c:yyfill:enable      = 0;
+
+'a' := return 'a';
+'b' := return 'b';
+
+*/
+}