--- /dev/null
+/* Generated by re2c */
+#line 1 "bug1454253.re"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define RET(n) return n
+
+size_t scan(const char *s, int l, char *r)
+{
+ const char *p = s;
+ const char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT (s+l)
+ #define YYMARKER q
+ #define YYFILL(n)
+
+ while(1)
+ {
+
+#line 23 "<stdout>"
+{
+ YYCTYPE yych;
+
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ switch(yych){
+ case 0x00: goto yy5;
+ case '?': goto yy3;
+ default: goto yy7;
+ }
+yy2:
+#line 40 "bug1454253.re"
+ {
+ *r++ = '0';
+ *r++ = '\0';
+ return p - s;
+ }
+#line 41 "<stdout>"
+yy3:
+ yych = *++YYCURSOR;
+ switch(yych){
+ case '!': goto yy12;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy9;
+ default: goto yy4;
+ }
+yy4:
+ YYMARKER = YYCURSOR + 1;
+ YYCURSOR = YYMARKER;
+ goto yy2;
+yy5:
+ ++YYCURSOR;
+#line 34 "bug1454253.re"
+ {
+ *r++ = '3';
+ *r++ = '\0';
+ return p - s;
+ }
+#line 121 "<stdout>"
+yy7:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch(yych){
+ case 0x00:
+ case '?': goto yy2;
+ default: goto yy7;
+ }
+yy9:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy9;
+ default: goto yy11;
+ }
+yy11:
+#line 29 "bug1454253.re"
+ {
+ *r++ = '2';
+ continue;
+ }
+#line 206 "<stdout>"
+yy12:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy12;
+ default: goto yy14;
+ }
+yy14:
+#line 24 "bug1454253.re"
+ {
+ *r++ = '1';
+ continue;
+ }
+#line 282 "<stdout>"
+}
+#line 45 "bug1454253.re"
+
+ }
+}
+
+void _do_scan(const char * str, size_t str_len, size_t scn_len, const char * exp, size_t exp_len)
+{
+ char res[32], sp[32];
+ size_t res_len, inp_len;
+
+ inp_len = scan(str, str_len, res);
+ res_len = strlen(res);
+
+ memset(sp, ' ', sizeof(sp));
+ sp[15 - str_len] = '\0';
+
+ printf("[%s](%2d/%2d)%s: %8s(%d) %s %8s(%d)\n", str, inp_len, scn_len, sp,
+ res, res_len,
+ inp_len != scn_len || exp_len != res_len || strncmp(exp, res, exp_len) ? "!=" : "==",
+ exp, exp_len);
+}
+
+#define do_scan(str, scn_len, exp) _do_scan(str, sizeof(str) - 1, scn_len, exp, sizeof(exp) - 1)
+
+main()
+{
+ do_scan("#", 1, "0");
+ do_scan("?!?a+", 5, "120");
+ do_scan("?1?2!1?2??", 6, "220");
+ do_scan("?1?2?!1?2??", 11, "22120");
+ do_scan("?1?2?!1?2?!", 12, "221213");
+ do_scan("?1?123?45??", 11, "2220");
+ do_scan("?1?123?45?!", 12, "22213");
+}
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define RET(n) return n
+
+size_t scan(const char *s, int l, char *r)
+{
+ const char *p = s;
+ const char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT (s+l)
+ #define YYMARKER q
+ #define YYFILL(n)
+
+ while(1)
+ {
+/*!re2c
+ ALNUM = [0-9a-zA-Z];
+ ANY = [\001-\377]\"?";
+ EOF = '\000';
+
+ "?!" ALNUM* {
+ *r++ = '1';
+ continue;
+ }
+
+ "?" ALNUM+ {
+ *r++ = '2';
+ continue;
+ }
+
+ EOF {
+ *r++ = '3';
+ *r++ = '\0';
+ return p - s;
+ }
+
+ ANY* {
+ *r++ = '0';
+ *r++ = '\0';
+ return p - s;
+ }
+*/
+ }
+}
+
+void _do_scan(const char * str, size_t str_len, size_t scn_len, const char * exp, size_t exp_len)
+{
+ char res[32], sp[32];
+ size_t res_len, inp_len;
+
+ inp_len = scan(str, str_len, res);
+ res_len = strlen(res);
+
+ memset(sp, ' ', sizeof(sp));
+ sp[15 - str_len] = '\0';
+
+ printf("[%s](%2d/%2d)%s: %8s(%d) %s %8s(%d)\n", str, inp_len, scn_len, sp,
+ res, res_len,
+ inp_len != scn_len || exp_len != res_len || strncmp(exp, res, exp_len) ? "!=" : "==",
+ exp, exp_len);
+}
+
+#define do_scan(str, scn_len, exp) _do_scan(str, sizeof(str) - 1, scn_len, exp, sizeof(exp) - 1)
+
+main()
+{
+ do_scan("#", 1, "0");
+ do_scan("?!?a+", 5, "120");
+ do_scan("?1?2!1?2??", 6, "220");
+ do_scan("?1?2?!1?2??", 11, "22120");
+ do_scan("?1?2?!1?2?!", 12, "221213");
+ do_scan("?1?123?45??", 11, "2220");
+ do_scan("?1?123?45?!", 12, "22213");
+}
--- /dev/null
+/* Generated by re2c */
+#line 1 "bug1454253.s.re"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define RET(n) return n
+
+size_t scan(const char *s, int l, char *r)
+{
+ const char *p = s;
+ const char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT (s+l)
+ #define YYMARKER q
+ #define YYFILL(n)
+
+ while(1)
+ {
+
+#line 23 "<stdout>"
+{
+ YYCTYPE yych;
+
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= 0x00) goto yy5;
+ if(yych == '?') goto yy3;
+ goto yy7;
+yy2:
+#line 40 "bug1454253.s.re"
+ {
+ *r++ = '0';
+ *r++ = '\0';
+ return p - s;
+ }
+#line 39 "<stdout>"
+yy3:
+ yych = *++YYCURSOR;
+ if(yych <= '9') {
+ if(yych == '!') goto yy12;
+ if(yych >= '0') goto yy9;
+ } else {
+ if(yych <= 'Z') {
+ if(yych >= 'A') goto yy9;
+ } else {
+ if(yych <= '`') goto yy4;
+ if(yych <= 'z') goto yy9;
+ }
+ }
+yy4:
+ YYMARKER = YYCURSOR + 1;
+ YYCURSOR = YYMARKER;
+ goto yy2;
+yy5:
+ ++YYCURSOR;
+#line 34 "bug1454253.s.re"
+ {
+ *r++ = '3';
+ *r++ = '\0';
+ return p - s;
+ }
+#line 64 "<stdout>"
+yy7:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 0x00) goto yy2;
+ if(yych == '?') goto yy2;
+ goto yy7;
+yy9:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') {
+ if(yych <= '/') goto yy11;
+ if(yych <= '9') goto yy9;
+ } else {
+ if(yych <= 'Z') goto yy9;
+ if(yych <= '`') goto yy11;
+ if(yych <= 'z') goto yy9;
+ }
+yy11:
+#line 29 "bug1454253.s.re"
+ {
+ *r++ = '2';
+ continue;
+ }
+#line 90 "<stdout>"
+yy12:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') {
+ if(yych <= '/') goto yy14;
+ if(yych <= '9') goto yy12;
+ } else {
+ if(yych <= 'Z') goto yy12;
+ if(yych <= '`') goto yy14;
+ if(yych <= 'z') goto yy12;
+ }
+yy14:
+#line 24 "bug1454253.s.re"
+ {
+ *r++ = '1';
+ continue;
+ }
+#line 109 "<stdout>"
+}
+#line 45 "bug1454253.s.re"
+
+ }
+}
+
+void _do_scan(const char * str, size_t str_len, size_t scn_len, const char * exp, size_t exp_len)
+{
+ char res[32], sp[32];
+ size_t res_len, inp_len;
+
+ inp_len = scan(str, str_len, res);
+ res_len = strlen(res);
+
+ memset(sp, ' ', sizeof(sp));
+ sp[15 - str_len] = '\0';
+
+ printf("[%s](%2d/%2d)%s: %8s(%d) %s %8s(%d)\n", str, inp_len, scn_len, sp,
+ res, res_len,
+ inp_len != scn_len || exp_len != res_len || strncmp(exp, res, exp_len) ? "!=" : "==",
+ exp, exp_len);
+}
+
+#define do_scan(str, scn_len, exp) _do_scan(str, sizeof(str) - 1, scn_len, exp, sizeof(exp) - 1)
+
+main()
+{
+ do_scan("#", 1, "0");
+ do_scan("?!?a+", 5, "120");
+ do_scan("?1?2!1?2??", 6, "220");
+ do_scan("?1?2?!1?2??", 11, "22120");
+ do_scan("?1?2?!1?2?!", 12, "221213");
+ do_scan("?1?123?45??", 11, "2220");
+ do_scan("?1?123?45?!", 12, "22213");
+}
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define RET(n) return n
+
+size_t scan(const char *s, int l, char *r)
+{
+ const char *p = s;
+ const char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT (s+l)
+ #define YYMARKER q
+ #define YYFILL(n)
+
+ while(1)
+ {
+/*!re2c
+ ALNUM = [0-9a-zA-Z];
+ ANY = [\001-\377]\"?";
+ EOF = '\000';
+
+ "?!" ALNUM* {
+ *r++ = '1';
+ continue;
+ }
+
+ "?" ALNUM+ {
+ *r++ = '2';
+ continue;
+ }
+
+ EOF {
+ *r++ = '3';
+ *r++ = '\0';
+ return p - s;
+ }
+
+ ANY* {
+ *r++ = '0';
+ *r++ = '\0';
+ return p - s;
+ }
+*/
+ }
+}
+
+void _do_scan(const char * str, size_t str_len, size_t scn_len, const char * exp, size_t exp_len)
+{
+ char res[32], sp[32];
+ size_t res_len, inp_len;
+
+ inp_len = scan(str, str_len, res);
+ res_len = strlen(res);
+
+ memset(sp, ' ', sizeof(sp));
+ sp[15 - str_len] = '\0';
+
+ printf("[%s](%2d/%2d)%s: %8s(%d) %s %8s(%d)\n", str, inp_len, scn_len, sp,
+ res, res_len,
+ inp_len != scn_len || exp_len != res_len || strncmp(exp, res, exp_len) ? "!=" : "==",
+ exp, exp_len);
+}
+
+#define do_scan(str, scn_len, exp) _do_scan(str, sizeof(str) - 1, scn_len, exp, sizeof(exp) - 1)
+
+main()
+{
+ do_scan("#", 1, "0");
+ do_scan("?!?a+", 5, "120");
+ do_scan("?1?2!1?2??", 6, "220");
+ do_scan("?1?2?!1?2??", 11, "22120");
+ do_scan("?1?2?!1?2?!", 12, "221213");
+ do_scan("?1?123?45??", 11, "2220");
+ do_scan("?1?123?45?!", 12, "22213");
+}
--- /dev/null
+/* Generated by re2c */
+#line 1 "bug1454253b.s.re"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define RET(n) return n
+
+size_t scan(const char *s, int l, char *r)
+{
+ const char *p = s;
+ const char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT (s+l)
+ #define YYMARKER q
+ #define YYFILL(n)
+
+ while(1)
+ {
+
+#line 23 "<stdout>"
+{
+ YYCTYPE yych;
+
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych != '?') goto yy4;
+ yych = *++YYCURSOR;
+ if(yych <= '9') {
+ if(yych == '!') goto yy9;
+ if(yych >= '0') goto yy6;
+ } else {
+ if(yych <= 'Z') {
+ if(yych >= 'A') goto yy6;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy6;
+ }
+ }
+yy3:
+yy4:
+ ++YYCURSOR;
+#line 33 "bug1454253b.s.re"
+ {
+ *r++ = '0';
+ *r++ = '\0';
+ return p - s;
+ }
+#line 51 "<stdout>"
+yy6:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') {
+ if(yych <= '/') goto yy8;
+ if(yych <= '9') goto yy6;
+ } else {
+ if(yych <= 'Z') goto yy6;
+ if(yych <= '`') goto yy8;
+ if(yych <= 'z') goto yy6;
+ }
+yy8:
+#line 28 "bug1454253b.s.re"
+ {
+ *r++ = '2';
+ continue;
+ }
+#line 70 "<stdout>"
+yy9:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') {
+ if(yych <= '/') goto yy11;
+ if(yych <= '9') goto yy9;
+ } else {
+ if(yych <= 'Z') goto yy9;
+ if(yych <= '`') goto yy11;
+ if(yych <= 'z') goto yy9;
+ }
+yy11:
+#line 23 "bug1454253b.s.re"
+ {
+ *r++ = '1';
+ continue;
+ }
+#line 89 "<stdout>"
+}
+#line 38 "bug1454253b.s.re"
+
+ }
+}
+
+void _do_scan(const char * str, size_t str_len, size_t scn_len, const char * exp, size_t exp_len)
+{
+ char res[32], sp[32];
+ size_t res_len, inp_len;
+
+ inp_len = scan(str, str_len, res);
+ res_len = strlen(res);
+
+ memset(sp, ' ', sizeof(sp));
+ sp[15 - str_len] = '\0';
+
+ printf("[%s](%2d/%2d)%s: %8s(%d) %s %8s(%d)\n", str, inp_len, scn_len, sp,
+ exp, exp_len,
+ inp_len != scn_len || exp_len != res_len || strncmp(exp, res, exp_len) ? "!=" : "==",
+ res, res_len);
+}
+
+#define do_scan(str, scn_len, exp) _do_scan(str, sizeof(str) - 1, scn_len, exp, sizeof(exp) - 1)
+
+main()
+{
+ do_scan("#", 1, "0");
+ do_scan("?!?a+", 5, "120");
+ do_scan("?1?2!1?2??", 5, "220");
+ do_scan("?1?2?!1?2??", 11, "22120");
+ do_scan("?1?2?!1?2?!", 12, "221210");
+ do_scan("?1?123?45??", 11, "2220");
+ do_scan("?1?123?45?!", 12, "22210");
+}
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define RET(n) return n
+
+size_t scan(const char *s, int l, char *r)
+{
+ const char *p = s;
+ const char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT (s+l)
+ #define YYMARKER q
+ #define YYFILL(n)
+
+ while(1)
+ {
+/*!re2c
+ ALNUM = [0-9a-zA-Z];
+ ANY = [\000-\377];
+
+ "?!" ALNUM* {
+ *r++ = '1';
+ continue;
+ }
+
+ "?" ALNUM+ {
+ *r++ = '2';
+ continue;
+ }
+
+ (ANY\"?") {
+ *r++ = '0';
+ *r++ = '\0';
+ return p - s;
+ }
+*/
+ }
+}
+
+void _do_scan(const char * str, size_t str_len, size_t scn_len, const char * exp, size_t exp_len)
+{
+ char res[32], sp[32];
+ size_t res_len, inp_len;
+
+ inp_len = scan(str, str_len, res);
+ res_len = strlen(res);
+
+ memset(sp, ' ', sizeof(sp));
+ sp[15 - str_len] = '\0';
+
+ printf("[%s](%2d/%2d)%s: %8s(%d) %s %8s(%d)\n", str, inp_len, scn_len, sp,
+ exp, exp_len,
+ inp_len != scn_len || exp_len != res_len || strncmp(exp, res, exp_len) ? "!=" : "==",
+ res, res_len);
+}
+
+#define do_scan(str, scn_len, exp) _do_scan(str, sizeof(str) - 1, scn_len, exp, sizeof(exp) - 1)
+
+main()
+{
+ do_scan("#", 1, "0");
+ do_scan("?!?a+", 5, "120");
+ do_scan("?1?2!1?2??", 5, "220");
+ do_scan("?1?2?!1?2??", 11, "22120");
+ do_scan("?1?2?!1?2?!", 12, "221210");
+ do_scan("?1?123?45??", 11, "2220");
+ do_scan("?1?123?45?!", 12, "22210");
+}