]> granicus.if.org Git - re2c/commitdiff
Added test for newline conversion.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 6 Mar 2019 12:05:25 +0000 (12:05 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 6 Mar 2019 12:05:25 +0000 (12:05 +0000)
re2c/test/newlines/nl_01.c [new file with mode: 0644]
re2c/test/newlines/nl_01.re [new file with mode: 0644]

diff --git a/re2c/test/newlines/nl_01.c b/re2c/test/newlines/nl_01.c
new file mode 100644 (file)
index 0000000..81e6c82
--- /dev/null
@@ -0,0 +1,40 @@
+/* Generated by re2c */
+#line 1 "newlines/nl_01.re"
+
+#line 2 "newlines/nl_01.re"
+
+yyt1
+
+#define YYMAXFILL 1
+
+
+
+#line 13 "newlines/nl_01.c"
+{
+       YYCTYPE yych;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       yyt1 = YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy3;
+       default:        goto yy2;
+       }
+yy2:
+       x = yyt1;
+#line 7 "newlines/nl_01.re"
+       {
+        ;
+    }
+#line 29 "newlines/nl_01.c"
+yy3:
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       switch (yych) {
+       case 'a':       goto yy3;
+       default:        goto yy2;
+       }
+}
+#line 10 "newlines/nl_01.re"
+
+newlines/nl_01.re:7:12: warning: rule matches empty string [-Wmatch-empty-string]
diff --git a/re2c/test/newlines/nl_01.re b/re2c/test/newlines/nl_01.re
new file mode 100644 (file)
index 0000000..74806a8
--- /dev/null
@@ -0,0 +1,10 @@
+\r
+/*!re2c re2c:flags:T = 1; */\r
+/*!stags:re2c format = "@@\r\n"; */\r
+/*!max:re2c*/\r
+\r
+/*!re2c\r
+    @x "a"* {\r
+        ;\r
+    }\r
+*/\r