diff options
author | Demi Obenour <demiobenour@gmail.com> | 2016-09-27 10:54:16 -0400 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-10-19 20:39:06 -0400 |
commit | 4bffa41e4ed434f1e2ba64ac5a8fe661fa089cfb (patch) | |
tree | 378e886700ac96e8c316f354f10e1e9a622144ea /src/main.c | |
parent | 7dcb10c048744192ab873ee10fb6a5d8b1640434 (diff) |
Improved M4 quotation
This fixes M4 quotation of certain strings beginning with `yy` (in
section 3 of the input file only) and character literals. The new
quotation method is also less brittle and faster.
Tests that relied on the old behavior were fixed.
Also, `yyconst` is no longer defined; use `const` (which it
unconditionally was defined to) instead.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -127,8 +127,8 @@ static char outfile_path[MAXLINE]; static int outfile_created = 0; static char *skelname = NULL; static int _stdout_closed = 0; /* flag to prevent double-fclose() on stdout. */ -const char *escaped_qstart = "[[]]M4_YY_NOOP[M4_YY_NOOP[M4_YY_NOOP[[]]"; -const char *escaped_qend = "[[]]M4_YY_NOOP]M4_YY_NOOP]M4_YY_NOOP[[]]"; +const char *escaped_qstart = "]]M4_YY_NOOP[M4_YY_NOOP[M4_YY_NOOP[["; +const char *escaped_qend = "]]M4_YY_NOOP]M4_YY_NOOP]M4_YY_NOOP[["; /* For debugging. The max number of filters to apply to skeleton. */ static int preproc_level = 1000; @@ -640,7 +640,7 @@ void flexend (int exit_status) "yypop_buffer_state", "yyensure_buffer_stack", "yyalloc", - "yyconst", + "const", "yyextra", "yyfree", "yyget_debug", @@ -1641,7 +1641,7 @@ void readin (void) OUT_BEGIN_CODE (); if (fullspd) - outn ("typedef yyconst struct yy_trans_info *yy_state_type;"); + outn ("typedef const struct yy_trans_info *yy_state_type;"); else if (!C_plus_plus) outn ("typedef int yy_state_type;"); OUT_END_CODE (); |