]> gcc.gnu.org Git - gcc.git/commitdiff
(readescape): New arg ignore_ptr.
authorRichard Stallman <rms@gnu.org>
Thu, 24 Sep 1992 06:53:13 +0000 (06:53 +0000)
committerRichard Stallman <rms@gnu.org>
Thu, 24 Sep 1992 06:53:13 +0000 (06:53 +0000)
(yylex): Pass new arg, handle result that comes back.

From-SVN: r2222

gcc/c-lex.c

index e98377317d4191d8a9d60e4c840d3bf1f10c75f4..6bae94e655a7c2459e375bced38941d3492cc490 100644 (file)
@@ -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
This page took 0.073823 seconds and 5 git commands to generate.