diff options
author | Demi Obenour <demiobenour@gmail.com> | 2016-11-08 10:05:49 -0500 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-11-08 12:49:44 -0500 |
commit | c8ad3d682fb0ea39e30a70449c7f88b8cd8da6b4 (patch) | |
tree | 5bf8e4a032a2dc7c64ccc7a3d8ffd6a5bc6b66d8 /tests | |
parent | 0af671a2750cf44855e29d92cbb7b33abd440c68 (diff) |
Fixes a major bug in Flex's own lexing of literals.
My changes caused Flex to mishandle string and character literals in
line comments. This commit fixes them.
Fixes #113.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/quote_in_comment.l | 16 | ||||
-rw-r--r-- | tests/quote_in_comment.txt | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 0c8df6a..4a08f4a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -88,6 +88,7 @@ simple_tests = \ posixly_correct \ prefix_nr \ prefix_r \ + quote_in_comment \ quotes \ string_nr \ string_r \ @@ -122,6 +123,7 @@ ONE_TESTS = \ lineno_r.one \ lineno_trailing.one +quote_in_comment_SOURCES = quote_in_comment.l alloc_extra_SOURCES = alloc_extra.l array_nr_SOURCES = array_nr.l array_r_SOURCES = array_r.l @@ -246,6 +248,7 @@ CLEANFILES = \ prefix_nr.c \ prefix_r.c \ pthread.c \ + quote_in_comment.c \ quotes.c \ reject_nr.reject.c \ reject_r.reject.c \ @@ -315,6 +318,7 @@ EXTRA_DIST = \ reject.txt \ rescan_nr.direct.txt \ rescan_r.direct.txt \ + quote_in_comment.txt \ quotes.txt \ top.txt \ yyextra.txt \ diff --git a/tests/quote_in_comment.l b/tests/quote_in_comment.l new file mode 100644 index 0000000..a5743c2 --- /dev/null +++ b/tests/quote_in_comment.l @@ -0,0 +1,16 @@ +%option 8bit noyywrap +%% +.|\n { ECHO; + //' " + } +%% +int +main (void) +{ + yyin = stdin; + yyout = stdout; + while (yylex()) + ; + printf("TEST RETURNING OK.\n"); + return 0; +} diff --git a/tests/quote_in_comment.txt b/tests/quote_in_comment.txt new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/tests/quote_in_comment.txt @@ -0,0 +1 @@ +test |