when default rules with conditions are used".
Default rule is handled in a special (delayed) way;
re2c uses different code for default rule than for normal rules.
This special code simply forgot to add condition name to the list
of conditions.
Thanks to sirzooro for bug report.
--- /dev/null
+/* Generated by re2c */
+#include <stdio.h>
+
+enum YYCONDTYPE {
+ yycinit,
+ yycC2,
+};
+
+
+int test(const char* str)
+{
+ const unsigned char* YYCURSOR = (const unsigned char*)str;
+ const unsigned char* YYMARKER;
+ const unsigned char *YYCTXMARKER;
+ int c = yycinit;
+
+
+{
+ unsigned char yych;
+ switch (c) {
+ case yycinit: goto yyc_init;
+ case yycC2: goto yyc_C2;
+ }
+/* *********************************** */
+yyc_init:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'A': goto yy5;
+ default: goto yy3;
+ }
+yy3:
+ ++YYCURSOR;
+ { return 0; }
+yy5:
+ ++YYCURSOR;
+ c = yycC2;
+ goto yyc_C2;
+/* *********************************** */
+yyc_C2:
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'B': goto yy11;
+ default: goto yy9;
+ }
+yy9:
+ ++YYCURSOR;
+ { return 0; }
+yy11:
+ ++YYCURSOR;
+ { return 1; }
+}
+
+}
+
+int main()
+{
+ printf("%d\n", test("AB"));
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+
+/*!types:re2c*/
+
+int test(const char* str)
+{
+ const unsigned char* YYCURSOR = (const unsigned char*)str;
+ const unsigned char* YYMARKER;
+ const unsigned char *YYCTXMARKER;
+ int c = yycinit;
+
+ /*!re2c
+ re2c:define:YYCTYPE = "unsigned char";
+ re2c:yyfill:enable = 0;
+ re2c:define:YYGETCONDITION = "c";
+ re2c:define:YYGETCONDITION:naked = 1;
+ re2c:define:YYSETCONDITION = "c = @@;";
+ re2c:define:YYSETCONDITION:naked = 1;
+
+ //<*>* { return 0; }
+ <init>* { return 0; }
+ <init>"A" :=> C2
+ <C2>* { return 0; }
+ <C2>"B" { return 1; }
+ */
+}
+
+int main()
+{
+ printf("%d\n", test("AB"));
+ return 0;
+}