]> granicus.if.org Git - re2c/commitdiff
Added cmd option "--empty-class <match-empty|match-none|error>".
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 16 Jun 2015 13:17:17 +0000 (14:17 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 16 Jun 2015 13:17:17 +0000 (14:17 +0100)
This option controls re2c actions when it encounters empty character
class (e.g. [], [^\0x00-\xFF] or [\0x00-\xFF]\[\0x00-\xFF]):
    match-empty (default) - match on empty input
    match-none - fail to match on any input
    error - compilation error

This is a final fix for bug #61 "empty character class [] matches empty string".

53 files changed:
re2c/src/globals.h
re2c/src/ir/regexp/empty_class_policy.h [new file with mode: 0644]
re2c/src/ir/regexp/regexp.cc
re2c/src/main.cc
re2c/test/bug61.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61.i--empty-class(error).re [moved from re2c/test/bug61a.i.re with 84% similarity]
re2c/test/bug61.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61.i.c
re2c/test/bug61.i.re
re2c/test/bug61_difference_full.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_difference_full.i.c [new file with mode: 0644]
re2c/test/bug61_difference_full.i.re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i.c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i.re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i.c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i.re [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_negative.i.c [new file with mode: 0644]
re2c/test/bug61_negative.i.re [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_positive.i.c [new file with mode: 0644]
re2c/test/bug61_positive.i.re [new file with mode: 0644]
re2c/test/bug61a.i.c [deleted file]

index 9f2549ad28c136d96314ef26cd2517cbbaca7945..d05f43a4995dad78ca6e0da3fe43412588cab706 100644 (file)
@@ -6,6 +6,7 @@
 #include "src/codegen/code_names.h"
 #include "src/codegen/input_api.h"
 #include "src/ir/regexp/encoding/enc.h"
+#include "src/ir/regexp/empty_class_policy.h"
 #include "src/util/c99_stdint.h"
 
 namespace re2c
@@ -74,6 +75,8 @@ extern CodeNames mapCodeName;
 extern Enc encoding;
 extern InputAPI input_api;
 
+extern empty_class_policy_t empty_class_policy;
+
 } // end namespace re2c
 
 #endif // _RE2C_GLOBALS_
diff --git a/re2c/src/ir/regexp/empty_class_policy.h b/re2c/src/ir/regexp/empty_class_policy.h
new file mode 100644 (file)
index 0000000..bb062de
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef _RE2C_IR_REGEXP_EMPTY_CLASS_POLICY_
+#define _RE2C_IR_REGEXP_EMPTY_CLASS_POLICY_
+
+namespace re2c {
+
+enum empty_class_policy_t
+{
+       EMPTY_CLASS_MATCH_EMPTY, // match on empty input
+       EMPTY_CLASS_MATCH_NONE, // fail to match on any input
+       EMPTY_CLASS_ERROR // compilation error
+};
+
+} // namespace re2c
+
+#endif // _RE2C_IR_REGEXP_EMPTY_CLASS_POLICY_
index d259531f16e4f830fae77ae744d79461c464cd4a..6e1cdc995127cdcf508575a3a4931c3165b29c46 100644 (file)
@@ -211,7 +211,16 @@ RegExp * Scanner::matchSymbolRange(Range * r) const
 {
        if (!r)
        {
-               return new NullOp;
+               switch (empty_class_policy)
+               {
+                       case EMPTY_CLASS_MATCH_EMPTY:
+                               return new NullOp;
+                       case EMPTY_CLASS_MATCH_NONE:
+                               break;
+                       case EMPTY_CLASS_ERROR:
+                               fatal ("empty character class");
+                               break;
+               }
        }
 
        if (encoding.is(Enc::UTF16))
index d97f7283acb567b864c7d0d9c95e0fd9ab34467e..ff2322e61a0ff9dfe8d8d295921aa22e683a8355 100644 (file)
@@ -64,6 +64,8 @@ bool bCaseInverted = false;
 Enc encoding;
 InputAPI input_api;
 
+empty_class_policy_t empty_class_policy = EMPTY_CLASS_MATCH_EMPTY;
+
 uint32_t last_fill_index = 0;
 CodeNames mapCodeName;
 
@@ -105,6 +107,7 @@ static const mbo_opt_struct OPTIONS[] =
        mbo_opt_struct(13,  1, "encoding-policy"),
        mbo_opt_struct(14,  1, "input"),
        mbo_opt_struct(15,  0, "skeleton"),
+       mbo_opt_struct(16,  1, "empty-class"),
        mbo_opt_struct('-', 0, NULL) /* end of args */
 };
 
@@ -198,6 +201,12 @@ static void usage()
        "--skeleton              Instead of embedding re2c-generated code into C/C++ source,\n"
        "                        generate a self-contained program for the same DFA.\n"
        "                        Most useful for correctness and performance testing.\n"
+       "\n"
+       "--empty-class policy    What to do if user inputs empty character class. policy can be\n"
+       "                        one of the following: 'match-empty' (match empty input, default),\n"
+       "                        'match-none' (fail to match on any input), 'error' (compilation\n"
+       "                        error). Note that there are various ways to construct empty class,\n"
+       "                        e.g: [], [^\\x00-\\xFF], [\\x00-\\xFF]\\[\\x00-\\xFF].\n"
        ;
 }
 
@@ -396,6 +405,20 @@ int main(int argc, char *argv[])
                        flag_skeleton = true;
                        input_api.set (InputAPI::CUSTOM);
                        break;
+
+                       case 16:
+                       if (strcmp(opt_arg, "match-empty") == 0)
+                               empty_class_policy = EMPTY_CLASS_MATCH_EMPTY;
+                       else if (strcmp(opt_arg, "match-none") == 0)
+                               empty_class_policy = EMPTY_CLASS_MATCH_NONE;
+                       else if (strcmp(opt_arg, "error") == 0)
+                               empty_class_policy = EMPTY_CLASS_ERROR;
+                       else
+                       {
+                               std::cerr << "re2c: error: Invalid empty class policy: \"" << opt_arg << "\"\n";
+                               return 1;
+                       }
+                       break;
                }
        }
 
diff --git a/re2c/test/bug61.i--empty-class(error).c b/re2c/test/bug61.i--empty-class(error).c
new file mode 100644 (file)
index 0000000..9bce616
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 5: empty character class
similarity index 84%
rename from re2c/test/bug61a.i.re
rename to re2c/test/bug61.i--empty-class(error).re
index 0e00561e00c9052e0251d86413d3a8a221974b82..6da4ba81aca2d7f8533d8ef0178c1b0afb536a39 100644 (file)
     [\x00-\xFF]\[\x00-\xFF] {}
 */
 
+/*!re2c
+    []\[] {}
+*/
+
 /*!re2c
     [^\x00-\xFF]\[^\x00-\xFF] {}
 */
diff --git a/re2c/test/bug61.i--empty-class(match-empty).c b/re2c/test/bug61.i--empty-class(match-empty).c
new file mode 100644 (file)
index 0000000..f5ff7f8
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 14, column 11: can only difference char sets
diff --git a/re2c/test/bug61.i--empty-class(match-empty).re b/re2c/test/bug61.i--empty-class(match-empty).re
new file mode 100644 (file)
index 0000000..6da4ba8
--- /dev/null
@@ -0,0 +1,19 @@
+/*!re2c
+    [] {}
+*/
+
+/*!re2c
+    [^\x00-\xFF] {}
+*/
+
+/*!re2c
+    [\x00-\xFF]\[\x00-\xFF] {}
+*/
+
+/*!re2c
+    []\[] {}
+*/
+
+/*!re2c
+    [^\x00-\xFF]\[^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61.i--empty-class(match-none).c b/re2c/test/bug61.i--empty-class(match-none).c
new file mode 100644 (file)
index 0000000..914f45e
--- /dev/null
@@ -0,0 +1,30 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+}
+
+
+
+{
+       YYCTYPE yych;
+}
+
+
+
+{
+       YYCTYPE yych;
+}
+
+
+
+{
+       YYCTYPE yych;
+}
+
+
+
+{
+       YYCTYPE yych;
+}
+
diff --git a/re2c/test/bug61.i--empty-class(match-none).re b/re2c/test/bug61.i--empty-class(match-none).re
new file mode 100644 (file)
index 0000000..6da4ba8
--- /dev/null
@@ -0,0 +1,19 @@
+/*!re2c
+    [] {}
+*/
+
+/*!re2c
+    [^\x00-\xFF] {}
+*/
+
+/*!re2c
+    [\x00-\xFF]\[\x00-\xFF] {}
+*/
+
+/*!re2c
+    []\[] {}
+*/
+
+/*!re2c
+    [^\x00-\xFF]\[^\x00-\xFF] {}
+*/
index 453370d6c04abdadaffbe1a4e8b6a79176ca3494..f5ff7f83058fbbea31398dbcc3620769144d1ebe 100644 (file)
@@ -1,21 +1 @@
-/* Generated by re2c */
-
-{
-       YYCTYPE yych;
-       {}
-}
-
-
-
-{
-       YYCTYPE yych;
-       {}
-}
-
-
-
-{
-       YYCTYPE yych;
-       {}
-}
-
+re2c: error: line 14, column 11: can only difference char sets
index 4937d7daeabe63335fd9f102974fdd08693600b3..6da4ba81aca2d7f8533d8ef0178c1b0afb536a39 100644 (file)
@@ -9,3 +9,11 @@
 /*!re2c
     [\x00-\xFF]\[\x00-\xFF] {}
 */
+
+/*!re2c
+    []\[] {}
+*/
+
+/*!re2c
+    [^\x00-\xFF]\[^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_full.i--empty-class(error).c b/re2c/test/bug61_difference_full.i--empty-class(error).c
new file mode 100644 (file)
index 0000000..70094ae
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 29: empty character class
diff --git a/re2c/test/bug61_difference_full.i--empty-class(error).re b/re2c/test/bug61_difference_full.i--empty-class(error).re
new file mode 100644 (file)
index 0000000..47ae4e1
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [\x00-\xFF]\[\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_full.i--empty-class(match-empty).c b/re2c/test/bug61_difference_full.i--empty-class(match-empty).c
new file mode 100644 (file)
index 0000000..6561f36
--- /dev/null
@@ -0,0 +1,7 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       {}
+}
+
diff --git a/re2c/test/bug61_difference_full.i--empty-class(match-empty).re b/re2c/test/bug61_difference_full.i--empty-class(match-empty).re
new file mode 100644 (file)
index 0000000..47ae4e1
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [\x00-\xFF]\[\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_full.i--empty-class(match-none).c b/re2c/test/bug61_difference_full.i--empty-class(match-none).c
new file mode 100644 (file)
index 0000000..823d040
--- /dev/null
@@ -0,0 +1,6 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+}
+
diff --git a/re2c/test/bug61_difference_full.i--empty-class(match-none).re b/re2c/test/bug61_difference_full.i--empty-class(match-none).re
new file mode 100644 (file)
index 0000000..47ae4e1
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [\x00-\xFF]\[\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_full.i.c b/re2c/test/bug61_difference_full.i.c
new file mode 100644 (file)
index 0000000..6561f36
--- /dev/null
@@ -0,0 +1,7 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       {}
+}
+
diff --git a/re2c/test/bug61_difference_full.i.re b/re2c/test/bug61_difference_full.i.re
new file mode 100644 (file)
index 0000000..47ae4e1
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [\x00-\xFF]\[\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_negative.i--empty-class(error).c b/re2c/test/bug61_difference_negative.i--empty-class(error).c
new file mode 100644 (file)
index 0000000..9bce616
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 5: empty character class
diff --git a/re2c/test/bug61_difference_negative.i--empty-class(error).re b/re2c/test/bug61_difference_negative.i--empty-class(error).re
new file mode 100644 (file)
index 0000000..71a4f7b
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF]\[^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_negative.i--empty-class(match-empty).c b/re2c/test/bug61_difference_negative.i--empty-class(match-empty).c
new file mode 100644 (file)
index 0000000..2e5aa92
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 31: can only difference char sets
diff --git a/re2c/test/bug61_difference_negative.i--empty-class(match-empty).re b/re2c/test/bug61_difference_negative.i--empty-class(match-empty).re
new file mode 100644 (file)
index 0000000..71a4f7b
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF]\[^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_negative.i--empty-class(match-none).c b/re2c/test/bug61_difference_negative.i--empty-class(match-none).c
new file mode 100644 (file)
index 0000000..823d040
--- /dev/null
@@ -0,0 +1,6 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+}
+
diff --git a/re2c/test/bug61_difference_negative.i--empty-class(match-none).re b/re2c/test/bug61_difference_negative.i--empty-class(match-none).re
new file mode 100644 (file)
index 0000000..71a4f7b
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF]\[^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_negative.i.c b/re2c/test/bug61_difference_negative.i.c
new file mode 100644 (file)
index 0000000..2e5aa92
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 31: can only difference char sets
diff --git a/re2c/test/bug61_difference_negative.i.re b/re2c/test/bug61_difference_negative.i.re
new file mode 100644 (file)
index 0000000..71a4f7b
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF]\[^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_difference_positive.i--empty-class(error).c b/re2c/test/bug61_difference_positive.i--empty-class(error).c
new file mode 100644 (file)
index 0000000..9bce616
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 5: empty character class
diff --git a/re2c/test/bug61_difference_positive.i--empty-class(error).re b/re2c/test/bug61_difference_positive.i--empty-class(error).re
new file mode 100644 (file)
index 0000000..bfad991
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    []\[] {}
+*/
diff --git a/re2c/test/bug61_difference_positive.i--empty-class(match-empty).c b/re2c/test/bug61_difference_positive.i--empty-class(match-empty).c
new file mode 100644 (file)
index 0000000..3cd856f
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 11: can only difference char sets
diff --git a/re2c/test/bug61_difference_positive.i--empty-class(match-empty).re b/re2c/test/bug61_difference_positive.i--empty-class(match-empty).re
new file mode 100644 (file)
index 0000000..bfad991
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    []\[] {}
+*/
diff --git a/re2c/test/bug61_difference_positive.i--empty-class(match-none).c b/re2c/test/bug61_difference_positive.i--empty-class(match-none).c
new file mode 100644 (file)
index 0000000..823d040
--- /dev/null
@@ -0,0 +1,6 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+}
+
diff --git a/re2c/test/bug61_difference_positive.i--empty-class(match-none).re b/re2c/test/bug61_difference_positive.i--empty-class(match-none).re
new file mode 100644 (file)
index 0000000..bfad991
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    []\[] {}
+*/
diff --git a/re2c/test/bug61_difference_positive.i.c b/re2c/test/bug61_difference_positive.i.c
new file mode 100644 (file)
index 0000000..3cd856f
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 11: can only difference char sets
diff --git a/re2c/test/bug61_difference_positive.i.re b/re2c/test/bug61_difference_positive.i.re
new file mode 100644 (file)
index 0000000..bfad991
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    []\[] {}
+*/
diff --git a/re2c/test/bug61_negative.i--empty-class(error).c b/re2c/test/bug61_negative.i--empty-class(error).c
new file mode 100644 (file)
index 0000000..9bce616
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 5: empty character class
diff --git a/re2c/test/bug61_negative.i--empty-class(error).re b/re2c/test/bug61_negative.i--empty-class(error).re
new file mode 100644 (file)
index 0000000..d94d97d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_negative.i--empty-class(match-empty).c b/re2c/test/bug61_negative.i--empty-class(match-empty).c
new file mode 100644 (file)
index 0000000..6561f36
--- /dev/null
@@ -0,0 +1,7 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       {}
+}
+
diff --git a/re2c/test/bug61_negative.i--empty-class(match-empty).re b/re2c/test/bug61_negative.i--empty-class(match-empty).re
new file mode 100644 (file)
index 0000000..d94d97d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_negative.i--empty-class(match-none).c b/re2c/test/bug61_negative.i--empty-class(match-none).c
new file mode 100644 (file)
index 0000000..823d040
--- /dev/null
@@ -0,0 +1,6 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+}
+
diff --git a/re2c/test/bug61_negative.i--empty-class(match-none).re b/re2c/test/bug61_negative.i--empty-class(match-none).re
new file mode 100644 (file)
index 0000000..d94d97d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_negative.i.c b/re2c/test/bug61_negative.i.c
new file mode 100644 (file)
index 0000000..6561f36
--- /dev/null
@@ -0,0 +1,7 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       {}
+}
+
diff --git a/re2c/test/bug61_negative.i.re b/re2c/test/bug61_negative.i.re
new file mode 100644 (file)
index 0000000..d94d97d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [^\x00-\xFF] {}
+*/
diff --git a/re2c/test/bug61_positive.i--empty-class(error).c b/re2c/test/bug61_positive.i--empty-class(error).c
new file mode 100644 (file)
index 0000000..9bce616
--- /dev/null
@@ -0,0 +1 @@
+re2c: error: line 2, column 5: empty character class
diff --git a/re2c/test/bug61_positive.i--empty-class(error).re b/re2c/test/bug61_positive.i--empty-class(error).re
new file mode 100644 (file)
index 0000000..48ed19d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [] {}
+*/
diff --git a/re2c/test/bug61_positive.i--empty-class(match-empty).c b/re2c/test/bug61_positive.i--empty-class(match-empty).c
new file mode 100644 (file)
index 0000000..6561f36
--- /dev/null
@@ -0,0 +1,7 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       {}
+}
+
diff --git a/re2c/test/bug61_positive.i--empty-class(match-empty).re b/re2c/test/bug61_positive.i--empty-class(match-empty).re
new file mode 100644 (file)
index 0000000..48ed19d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [] {}
+*/
diff --git a/re2c/test/bug61_positive.i--empty-class(match-none).c b/re2c/test/bug61_positive.i--empty-class(match-none).c
new file mode 100644 (file)
index 0000000..823d040
--- /dev/null
@@ -0,0 +1,6 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+}
+
diff --git a/re2c/test/bug61_positive.i--empty-class(match-none).re b/re2c/test/bug61_positive.i--empty-class(match-none).re
new file mode 100644 (file)
index 0000000..48ed19d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [] {}
+*/
diff --git a/re2c/test/bug61_positive.i.c b/re2c/test/bug61_positive.i.c
new file mode 100644 (file)
index 0000000..6561f36
--- /dev/null
@@ -0,0 +1,7 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       {}
+}
+
diff --git a/re2c/test/bug61_positive.i.re b/re2c/test/bug61_positive.i.re
new file mode 100644 (file)
index 0000000..48ed19d
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    [] {}
+*/
diff --git a/re2c/test/bug61a.i.c b/re2c/test/bug61a.i.c
deleted file mode 100644 (file)
index 39becbe..0000000
+++ /dev/null
@@ -1 +0,0 @@
-re2c: error: line 14, column 31: can only difference char sets