aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-24 06:53:13 +0000
committerRichard Stallman <rms@gnu.org>1992-09-24 06:53:13 +0000
commitb70af677f28020e48e4d80a036ad19c25ee8f389 (patch)
treea78ff9b2cff0800ef5d7a2a3b88afa65427ab6e2
parent3b647566f77e7f7bac9936132c4d389f69240fea (diff)
downloadgcc-b70af677f28020e48e4d80a036ad19c25ee8f389.zip
gcc-b70af677f28020e48e4d80a036ad19c25ee8f389.tar.gz
gcc-b70af677f28020e48e4d80a036ad19c25ee8f389.tar.bz2
(readescape): New arg ignore_ptr.
(yylex): Pass new arg, handle result that comes back. From-SVN: r2222
-rw-r--r--gcc/c-lex.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index e983773..6bae94e 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -794,10 +794,11 @@ handle_sysv_pragma (input, c)
#define ENDFILE -1 /* token that represents end-of-file */
/* Read an escape sequence, returning its equivalent as a character,
- or -1 if it is backslash-newline. */
+ or store 1 in *ignore_ptr if it is backslash-newline. */
static int
-readescape ()
+readescape (ignore_ptr)
+ int *ignore_ptr;
{
register int c = getc (finput);
register int code;
@@ -868,7 +869,8 @@ readescape ()
case '\n':
lineno++;
- return -1;
+ *ignore_ptr = 1;
+ return 0;
case 'n':
return TARGET_NEWLINE;
@@ -1637,8 +1639,9 @@ yylex ()
if (c == '\\')
{
- c = readescape ();
- if (c < 0)
+ int ignore = 0;
+ c = readescape (&ignore);
+ if (ignore)
goto tryagain;
if (width < HOST_BITS_PER_INT
&& (unsigned) c >= (1 << width))
@@ -1735,8 +1738,9 @@ yylex ()
/* ignore_escape_flag is set for reading the filename in #line. */
if (!ignore_escape_flag && c == '\\')
{
- c = readescape ();
- if (c < 0)
+ int ignore;
+ c = readescape (&ignore);
+ if (ignore)
goto skipnewline;
if (!wide_flag
&& TYPE_PRECISION (char_type_node) < HOST_BITS_PER_INT