Commit cf1d841d by Paul Eggert

(ignore_escape_flag): Remove var.

(check_newline, yylex): Do not ignore escapes when reading file names,
because escapes are the only way to represent file names containing '"'.

From-SVN: r5528
parent 0d38001f
...@@ -91,9 +91,6 @@ static int nextchar = -1; ...@@ -91,9 +91,6 @@ static int nextchar = -1;
int check_newline (); int check_newline ();
/* Nonzero tells yylex to ignore \ in string constants. */
static int ignore_escape_flag = 0;
/* C code produced by gperf version 2.5 (GNU C++ version) */ /* C code produced by gperf version 2.5 (GNU C++ version) */
/* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ c-parse.gperf */ /* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ c-parse.gperf */
struct resword { char *name; short token; enum rid rid; }; struct resword { char *name; short token; enum rid rid; };
...@@ -716,10 +713,8 @@ linenum: ...@@ -716,10 +713,8 @@ linenum:
/* More follows: it must be a string constant (filename). */ /* More follows: it must be a string constant (filename). */
/* Read the string constant, but don't treat \ as special. */ /* Read the string constant. */
ignore_escape_flag = 1;
token = yylex (); token = yylex ();
ignore_escape_flag = 0;
if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST) if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST)
{ {
...@@ -1938,8 +1933,7 @@ yylex () ...@@ -1938,8 +1933,7 @@ yylex ()
while (c != '"' && c >= 0) while (c != '"' && c >= 0)
{ {
/* ignore_escape_flag is set for reading the filename in #line. */ if (c == '\\')
if (!ignore_escape_flag && c == '\\')
{ {
int ignore = 0; int ignore = 0;
c = readescape (&ignore); c = readescape (&ignore);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment