lex.c (check_newline): Add support for \ as `natural' characters in file names in #line to be...
Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com> * lex.c (check_newline): Add support for \ as `natural' characters in file names in #line to be consistent with #include handling. We support escape prcessing in the # 1 "..." version of the command. From-SVN: r24157
This commit is contained in:
parent
c25d8793cc
commit
069f7cf27a
2 changed files with 21 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com>
|
||||||
|
|
||||||
|
* lex.c (check_newline): Add support for \ as `natural'
|
||||||
|
characters in file names in #line to be consistent with #include
|
||||||
|
handling. We support escape prcessing in the # 1 "..." version of
|
||||||
|
the command. See also support in cp/lex.c.
|
||||||
|
|
||||||
1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
|
1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
|
||||||
|
|
||||||
* cp/decl2.c: s/data/opts/ when initializing cpp_reader
|
* cp/decl2.c: s/data/opts/ when initializing cpp_reader
|
||||||
|
|
17
gcc/cp/lex.c
17
gcc/cp/lex.c
|
@ -2266,6 +2266,7 @@ check_newline ()
|
||||||
{
|
{
|
||||||
register int c;
|
register int c;
|
||||||
register int token;
|
register int token;
|
||||||
|
int saw_line = 0;
|
||||||
|
|
||||||
/* Read first nonwhite char on the line. Do this before incrementing the
|
/* Read first nonwhite char on the line. Do this before incrementing the
|
||||||
line number, in case we're at the end of saved text. */
|
line number, in case we're at the end of saved text. */
|
||||||
|
@ -2374,7 +2375,10 @@ check_newline ()
|
||||||
&& getch () == 'n'
|
&& getch () == 'n'
|
||||||
&& getch () == 'e'
|
&& getch () == 'e'
|
||||||
&& ((c = getch ()) == ' ' || c == '\t'))
|
&& ((c = getch ()) == ' ' || c == '\t'))
|
||||||
goto linenum;
|
{
|
||||||
|
saw_line = 1;
|
||||||
|
goto linenum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (c == 'i')
|
else if (c == 'i')
|
||||||
{
|
{
|
||||||
|
@ -2471,9 +2475,16 @@ 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. */
|
if (saw_line)
|
||||||
ignore_escape_flag = 1;
|
{
|
||||||
|
/* Don't treat \ as special if we are processing #line 1 "...".
|
||||||
|
If you want it to be treated specially, use # 1 "...". */
|
||||||
|
ignore_escape_flag = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read the string constant. */
|
||||||
token = real_yylex ();
|
token = real_yylex ();
|
||||||
|
|
||||||
ignore_escape_flag = 0;
|
ignore_escape_flag = 0;
|
||||||
|
|
||||||
if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST)
|
if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST)
|
||||||
|
|
Loading…
Add table
Reference in a new issue