From: helly Date: Thu, 13 Mar 2008 17:47:07 +0000 (+0000) Subject: - Add new tests X-Git-Tag: 0.13.6~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f67dc53192ebf60a63a61ffd3d4aa5d3f3c906ec;p=re2c - Add new tests - Fix expected error messages (line numbers correct now) --- diff --git a/re2c/test/cond_error_10.c.c b/re2c/test/cond_error_10.c.c index 1cb5763d..9ffacd65 100755 --- a/re2c/test/cond_error_10.c.c +++ b/re2c/test/cond_error_10.c.c @@ -1 +1 @@ -re2c: error: line 8, column 1: Setup for non existing rule 'c' found +re2c: error: line 6, column 1: Setup for non existing rule 'c' found diff --git a/re2c/test/cond_error_11.c.c b/re2c/test/cond_error_11.c.c index 45a51bb7..5909407d 100755 --- a/re2c/test/cond_error_11.c.c +++ b/re2c/test/cond_error_11.c.c @@ -1 +1 @@ -re2c: error: line 9, column 1: Setup for all rules with '*' not possible when all rules are setup explicitly +re2c: error: line 7, column 1: Setup for all rules with '*' not possible when all rules are setup explicitly diff --git a/re2c/test/error13.1.c b/re2c/test/error13.1.c index ad7e15cd..e44533a1 100755 --- a/re2c/test/error13.1.c +++ b/re2c/test/error13.1.c @@ -2,4 +2,4 @@ #line 1 "error13.1.re" #define YYMAXFILL 1 -re2c: error: line 0, column 1: found scanner block after YYMAXFILL declaration +re2c: error: line 3, column 1: found scanner block after YYMAXFILL declaration diff --git a/re2c/test/error14.1.c b/re2c/test/error14.1.c index 789c4d9c..23bdd383 100755 --- a/re2c/test/error14.1.c +++ b/re2c/test/error14.1.c @@ -50,4 +50,4 @@ yy9: #define YYMAXFILL 3 -re2c: error: line 5, column 1: cannot generate YYMAXFILL twice +re2c: error: line 9, column 1: cannot generate YYMAXFILL twice diff --git a/re2c/test/error14.c b/re2c/test/error14.c index 7235d523..3583e1d6 100755 --- a/re2c/test/error14.c +++ b/re2c/test/error14.c @@ -1 +1 @@ -re2c: error: line 5, column 1: cannot generate YYMAXFILL twice +re2c: error: line 9, column 1: cannot generate YYMAXFILL twice diff --git a/re2c/test/repeat-00.cgi.c b/re2c/test/repeat-00.cgi.c index 2e3edb76..63a649cb 100755 --- a/re2c/test/repeat-00.cgi.c +++ b/re2c/test/repeat-00.cgi.c @@ -1 +1 @@ -re2c: error: line 17, column 1: Cannot reuse scanner definition without -r flag +re2c: error: line 22, column 1: Cannot reuse scanner definition without -r flag diff --git a/re2c/test/repeat-03.cgir.c b/re2c/test/repeat-03.cgir.c new file mode 100755 index 00000000..8fa88c2b --- /dev/null +++ b/re2c/test/repeat-03.cgir.c @@ -0,0 +1 @@ +re2c: error: line 21, column 10: Rules not allowed in 'repeat:re2c' block diff --git a/re2c/test/repeat-03.cgir.re b/re2c/test/repeat-03.cgir.re new file mode 100755 index 00000000..80416eb4 --- /dev/null +++ b/re2c/test/repeat-03.cgir.re @@ -0,0 +1,24 @@ +// multiple scanners, error + +/*!types:re2c */ + +void scan(unsigned char* in) +{ +/*!re2c + +<*> "1" { return "1"; } +<*> "2" { return "2"; } + "a" { return "a"; } + "b" { return "b"; } + +*/ +} + +void scan(unsigned short* in) +{ +/*!repeat:re2c + + "c" { return "c"; } + +*/ +} diff --git a/re2c/test/repeat-04.cgir.c b/re2c/test/repeat-04.cgir.c new file mode 100755 index 00000000..56460c07 --- /dev/null +++ b/re2c/test/repeat-04.cgir.c @@ -0,0 +1 @@ +re2c: error: line 20, column 1: Cannot have another 're2c' block after a block containing rules diff --git a/re2c/test/repeat-04.cgir.re b/re2c/test/repeat-04.cgir.re new file mode 100755 index 00000000..3d53c4d4 --- /dev/null +++ b/re2c/test/repeat-04.cgir.re @@ -0,0 +1,23 @@ +// multiple scanners, error + +/*!types:re2c */ + +void scan(unsigned char* in) +{ +/*!re2c +re2c:define:YYCTYPE = 'unsigned char'; +*/ + +/*!re2c + +<*> "1" { return "1"; } +<*> "2" { return "2"; } + "a" { return "a"; } + "b" { return "b"; } + +*/ +/* Next block is not possible */ +/*!re2c +*/ +} + \ No newline at end of file