]> granicus.if.org Git - re2c/commitdiff
Added some tests for GTOP closure algorithm.
authorUlya Trofimovich <skvadrik@gmail.com>
Thu, 3 Jan 2019 11:26:51 +0000 (11:26 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Thu, 3 Jan 2019 11:26:51 +0000 (11:26 +0000)
52 files changed:
re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]
re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).c [new file with mode: 0644]
re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).re [new file with mode: 0644]

diff --git a/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..8de9b9e
--- /dev/null
@@ -0,0 +1,49 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt2 = yyt3 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..6a80194
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (a|aa)*
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..8de9b9e
--- /dev/null
@@ -0,0 +1,49 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt2 = yyt3 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..8188743
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (aa|a)*
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..4b31e35
--- /dev/null
@@ -0,0 +1,27 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       ++YYCURSOR;
+       yyt1 = NULL;
+       yynmatch = 2;
+       yypmatch[2] = yyt1;
+       yypmatch[3] = yyt1;
+       yypmatch[0] = YYCURSOR - 1;
+       yypmatch[1] = YYCURSOR;
+       {}
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..04913f7
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    a|(a)
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..00dfd33
--- /dev/null
@@ -0,0 +1,29 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       ++YYCURSOR;
+       yyt2 = YYCURSOR;
+       yynmatch = 2;
+       yypmatch[2] = yyt1;
+       yypmatch[3] = yyt2;
+       yypmatch[0] = YYCURSOR - 1;
+       yypmatch[1] = YYCURSOR;
+       {}
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..2e6e478
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (a)|a
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..8236d2c
--- /dev/null
@@ -0,0 +1,42 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'b':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt2 = YYCURSOR;
+               goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       goto yy2;
+yy5:
+       ++YYCURSOR;
+       yyt3 = NULL;
+       yynmatch = 3;
+       yypmatch[2] = yyt1;
+       yypmatch[3] = yyt2;
+       yypmatch[4] = yyt3;
+       yypmatch[5] = yyt3;
+       yypmatch[0] = YYCURSOR - 2;
+       yypmatch[1] = YYCURSOR;
+       {}
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..4825bbc
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (b)a|b(a)
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..8857af4
--- /dev/null
@@ -0,0 +1,41 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'b':       goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt1 = YYCURSOR;
+               goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       goto yy2;
+yy5:
+       ++YYCURSOR;
+       yyt3 = NULL;
+       yyt2 = YYCURSOR;
+       yynmatch = 3;
+       yypmatch[2] = yyt1;
+       yypmatch[3] = yyt2;
+       yypmatch[4] = yyt3;
+       yypmatch[5] = yyt3;
+       yypmatch[0] = YYCURSOR - 2;
+       yypmatch[1] = YYCURSOR;
+       {}
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..daa8211
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    b(a)|(b)a
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..f6d6fba
--- /dev/null
@@ -0,0 +1,37 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt2 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt2;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy3;
+       default:
+               yyt2 = NULL;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..c95394d
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    a*|(a|aa)*
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..8de9b9e
--- /dev/null
@@ -0,0 +1,49 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt2 = yyt3 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..846ae97
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (a|aa)*|a*
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..e7f0902
--- /dev/null
@@ -0,0 +1,99 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'a':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt1 = yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       yyt1 = yyt2 = yyt3 = YYCURSOR;
+       goto yy2;
+yy5:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy6;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy6:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       yyt3 = YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy7;
+       default:        goto yy2;
+       }
+yy7:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt4 = YYCURSOR;
+               goto yy8;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy8:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy9;
+       default:
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy9:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy10;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy10:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy5;
+       default:
+               yyt2 = yyt4;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..152512a
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (aa*|aaa*)*
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..25e6925
--- /dev/null
@@ -0,0 +1,97 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'a':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 3;
+       yypmatch[2] = yyt1;
+       yypmatch[4] = yyt2;
+       yypmatch[0] = yyt1;
+       yypmatch[1] = YYCURSOR;
+       yypmatch[3] = yyt2;
+       yypmatch[5] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       yyt1 = yyt2 = YYCURSOR;
+       goto yy2;
+yy5:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy6;
+       default:
+               yyt2 = YYCURSOR;
+               goto yy2;
+       }
+yy6:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       yyt2 = YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy7;
+       default:        goto yy2;
+       }
+yy7:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt3 = YYCURSOR;
+               goto yy8;
+       default:
+               yyt2 = YYCURSOR;
+               goto yy2;
+       }
+yy8:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy9;
+       default:        goto yy2;
+       }
+yy9:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy10;
+       default:
+               yyt2 = YYCURSOR;
+               goto yy2;
+       }
+yy10:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy5;
+       default:
+               yyt2 = yyt3;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..19275b6
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (aa*|aaa*)(aa*|aaa*)
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..676775c
--- /dev/null
@@ -0,0 +1,117 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       unsigned int yyaccept = 0;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'a':
+               yyt3 = yyt4 = NULL;
+               yyt1 = yyt2 = yyt5 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt2 = yyt3 = yyt4 = yyt5 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 3;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[4] = yyt5;
+       yypmatch[5] = yyt4;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       switch (yyaccept) {
+       case 0: 
+               yyt2 = yyt3 = yyt4 = yyt5 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       case 1: 
+               yyt4 = yyt5 = NULL;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       default:
+               yyt2 = yyt6;
+               yyt4 = yyt5 = NULL;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy5:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt2 = YYCURSOR;
+               goto yy6;
+       default:
+               yyt4 = yyt5 = NULL;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy6:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy7;
+       default:
+               yyt2 = yyt4;
+               yyt4 = YYCURSOR;
+               goto yy2;
+       }
+yy7:
+       yyaccept = 1;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt6 = YYCURSOR;
+               goto yy8;
+       default:
+               yyt4 = yyt5 = NULL;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy8:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy9;
+       default:        goto yy4;
+       }
+yy9:
+       yyaccept = 2;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':
+               yyt2 = yyt5 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt2 = yyt6;
+               yyt4 = yyt5 = NULL;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..009ec8b
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (aa)*|(aaa)*
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..0d65e79
--- /dev/null
@@ -0,0 +1,292 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       unsigned int yyaccept = 0;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'X':
+               yyt1 = yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt1 = yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt1 = yyt3 = YYCURSOR;
+               goto yy7;
+       case 'b':
+               yyt1 = yyt3 = YYCURSOR;
+               goto yy9;
+       default:
+               yyt2 = yyt3 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yyaccept = 1;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt4 = YYCURSOR;
+               goto yy10;
+       case 'b':
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy9;
+       default:
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy5:
+       yyaccept = 1;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy7;
+       case 'b':
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy9;
+       default:
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy7:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'b':       goto yy11;
+       default:        goto yy8;
+       }
+yy8:
+       YYCURSOR = YYMARKER;
+       switch (yyaccept) {
+       case 0: 
+               yyt2 = yyt3 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       case 1: 
+               yyt3 = YYCURSOR;
+               goto yy2;
+       case 2: 
+               yyt2 = yyt4;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       default:
+               yyt2 = yyt5;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy9:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'Y':       goto yy5;
+       case 'a':       goto yy12;
+       default:        goto yy8;
+       }
+yy10:
+       yyaccept = 1;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy7;
+       case 'b':
+               yyt5 = YYCURSOR;
+               goto yy13;
+       default:
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy11:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy14;
+       default:        goto yy8;
+       }
+yy12:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'b':       goto yy15;
+       default:        goto yy8;
+       }
+yy13:
+       yyaccept = 1;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt2 = YYCURSOR;
+               goto yy16;
+       case 'b':
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy9;
+       default:
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy14:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'b':       goto yy5;
+       default:        goto yy8;
+       }
+yy15:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy5;
+       default:        goto yy8;
+       }
+yy16:
+       yyaccept = 1;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy7;
+       case 'b':
+               yyt3 = YYCURSOR;
+               goto yy17;
+       default:
+               yyt2 = yyt3;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy17:
+       yyaccept = 2;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':       goto yy5;
+       case 'a':
+               yyt4 = YYCURSOR;
+               goto yy18;
+       case 'b':
+               yyt3 = YYCURSOR;
+               goto yy9;
+       default:
+               yyt2 = yyt4;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy18:
+       yyaccept = 3;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt3 = YYCURSOR;
+               goto yy7;
+       case 'b':
+               yyt5 = YYCURSOR;
+               goto yy19;
+       default:
+               yyt2 = yyt5;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy19:
+       yyaccept = 1;
+       YYMARKER = ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'X':
+               yyt3 = YYCURSOR;
+               goto yy3;
+       case 'Y':
+               yyt3 = YYCURSOR;
+               goto yy5;
+       case 'a':
+               yyt2 = YYCURSOR;
+               goto yy16;
+       case 'b':
+               yyt3 = YYCURSOR;
+               goto yy9;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..e27fe69
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (X|Xa|Xab|Xaba|abab|baba|bY|Y)*
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..b37036a
--- /dev/null
@@ -0,0 +1,40 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'y':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       goto yy2;
+yy5:
+       ++YYCURSOR;
+       yyt3 = YYCURSOR;
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..bb541b2
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y){2}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..d9d28c1
--- /dev/null
@@ -0,0 +1,41 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt2 = yyt3 = NULL;
+               yyt1 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       yyt3 = YYCURSOR;
+       goto yy2;
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..f5be94a
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y){0,2}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..b3d8b0b
--- /dev/null
@@ -0,0 +1,41 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy5;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy4;
+       }
+yy4:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy5:
+       ++YYCURSOR;
+       yyt3 = YYCURSOR;
+       goto yy4;
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..7ddd667
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y){1,2}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..33dc952
--- /dev/null
@@ -0,0 +1,50 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt3 = yyt4 = YYCURSOR;
+               goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       goto yy2;
+yy5:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt3 = YYCURSOR;
+               goto yy7;
+       default:        goto yy6;
+       }
+yy6:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy7:
+       ++YYCURSOR;
+       yyt2 = yyt4;
+       goto yy6;
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..1925893
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y){1,2}y
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..b130876
--- /dev/null
@@ -0,0 +1,47 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy5;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy4;
+       }
+yy4:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy5:
+       yych = *++YYCURSOR;
+       yyt3 = YYCURSOR;
+       switch (yych) {
+       case 'y':       goto yy6;
+       default:        goto yy4;
+       }
+yy6:
+       ++YYCURSOR;
+       goto yy4;
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..593f4f5
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y){1,2}y?
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..ab2c932
--- /dev/null
@@ -0,0 +1,50 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'y':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       goto yy2;
+yy5:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy5;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy7;
+       }
+yy7:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..e4f059a
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y){2,}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..e05ef80
--- /dev/null
@@ -0,0 +1,40 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt1 = yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       yyt3 = YYCURSOR;
+       goto yy2;
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..aa802ef
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y?){2}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..c06320c
--- /dev/null
@@ -0,0 +1,40 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt1 = yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       yyt3 = YYCURSOR;
+       goto yy2;
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..64dc237
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y?){0,2}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..c06320c
--- /dev/null
@@ -0,0 +1,40 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt1 = yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       yyt3 = YYCURSOR;
+       goto yy2;
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..4269fa7
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y?){1,2}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..6651362
--- /dev/null
@@ -0,0 +1,47 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = yyt3 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt3 = yyt4 = YYCURSOR;
+               goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy5:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt3 = YYCURSOR;
+               goto yy6;
+       default:        goto yy4;
+       }
+yy6:
+       ++YYCURSOR;
+       yyt2 = yyt4;
+       goto yy4;
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..ab899d3
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y?){1,2}y
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..af72b8b
--- /dev/null
@@ -0,0 +1,46 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt1 = yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       yych = *++YYCURSOR;
+       yyt3 = YYCURSOR;
+       switch (yych) {
+       case 'y':       goto yy5;
+       default:        goto yy2;
+       }
+yy5:
+       ++YYCURSOR;
+       goto yy2;
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..b194617
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y?){1,2}y?
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..c7d9e28
--- /dev/null
@@ -0,0 +1,48 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:
+               yyt1 = yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt2 = yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..820b29b
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y?){2,}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..15c7f20
--- /dev/null
@@ -0,0 +1,94 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'x':
+               yyt1 = yyt2 = yyt4 = YYCURSOR;
+               goto yy3;
+       case 'y':
+               yyt1 = yyt2 = YYCURSOR;
+               goto yy4;
+       default:
+               yyt1 = yyt2 = yyt3 = yyt4 = yyt5 = YYCURSOR;
+               goto yy2;
+       }
+yy2:
+       yynmatch = 3;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[4] = yyt4;
+       yypmatch[5] = yyt5;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'x':
+               yyt2 = yyt4 = YYCURSOR;
+               goto yy5;
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy6;
+       default:
+               yyt3 = yyt5 = YYCURSOR;
+               goto yy2;
+       }
+yy4:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'x':
+               yyt2 = yyt4 = YYCURSOR;
+               goto yy5;
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy6;
+       default:
+               yyt4 = yyt5 = NULL;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy5:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'x':
+               yyt2 = yyt4 = YYCURSOR;
+               goto yy7;
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy8;
+       default:
+               yyt3 = yyt5 = YYCURSOR;
+               goto yy2;
+       }
+yy6:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'x':
+               yyt2 = yyt4 = YYCURSOR;
+               goto yy7;
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy8;
+       default:
+               yyt4 = yyt5 = NULL;
+               yyt3 = YYCURSOR;
+               goto yy2;
+       }
+yy7:
+       ++YYCURSOR;
+       yyt3 = yyt5 = YYCURSOR;
+       goto yy2;
+yy8:
+       ++YYCURSOR;
+       yyt4 = yyt5 = NULL;
+       yyt3 = YYCURSOR;
+       goto yy2;
+}
+
+re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
+re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules]
diff --git a/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..837952c
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y|(x?)){1,3}
+    {}
+    "" {}
+*/
diff --git a/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).c
new file mode 100644 (file)
index 0000000..8659cbf
--- /dev/null
@@ -0,0 +1,76 @@
+/* Generated by re2c */
+
+{
+       YYCTYPE yych;
+       if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+       yych = *(YYMARKER = YYCURSOR);
+       switch (yych) {
+       case 'y':
+               yyt1 = YYCURSOR;
+               goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       yynmatch = 1;
+       yypmatch[0] = YYCURSOR;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy3:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':       goto yy5;
+       default:        goto yy4;
+       }
+yy4:
+       YYCURSOR = YYMARKER;
+       goto yy2;
+yy5:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy6;
+       default:        goto yy4;
+       }
+yy6:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy8;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy7;
+       }
+yy7:
+       yynmatch = 2;
+       yypmatch[0] = yyt1;
+       yypmatch[2] = yyt2;
+       yypmatch[3] = yyt3;
+       yypmatch[1] = YYCURSOR;
+       {}
+yy8:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':
+               yyt2 = YYCURSOR;
+               goto yy9;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy7;
+       }
+yy9:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'y':       goto yy10;
+       default:
+               yyt3 = YYCURSOR;
+               goto yy7;
+       }
+yy10:
+       ++YYCURSOR;
+       yyt3 = YYCURSOR;
+       goto yy7;
+}
+
+re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).re
new file mode 100644 (file)
index 0000000..800b242
--- /dev/null
@@ -0,0 +1,7 @@
+/*!re2c
+    re2c:flags:posix-captures = 1;
+
+    (y[y]?){3}
+    {}
+    "" {}
+*/