cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag when removing escaped newlines.
authorNeil Booth <neilb@earthling.net>
Wed, 10 May 2000 09:11:06 +0000 (09:11 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Wed, 10 May 2000 09:11:06 +0000 (09:11 +0000)
        * cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag
        when removing escaped newlines.  Reverse sense of test for
        escaped newline.

From-SVN: r33816

gcc/ChangeLog
gcc/cpplex.c

index ea8972bdb6ee974a588885ec8265d1c72af1a220..654951d127865aa9cc965203b7e21c83afa75a65 100644 (file)
@@ -1,3 +1,9 @@
+Wed 10 May 09:08:30 2000  Neil Booth  <NeilB@earthling.net>
+
+        * cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag
+        when removing escaped newlines.  Reverse sense of test for
+        escaped newline.
+
 2000-05-09  Richard Henderson  <rth@cygnus.com>
 
        * flow.c (find_basic_blocks_1): Do not delete the first
index 65c4b288971816e8df9dc0610424b6523c9a1e59..c828eef7724cff82f281a1c74093ec935e7477b7 100644 (file)
@@ -3010,30 +3010,31 @@ _cpp_lex_line (pfile, list)
        case '\n':
        case '\r':
          handle_newline (cur, buffer->rlimit, c);
-         if (PREV_TOKEN_TYPE != CPP_BACKSLASH || !IMMED_TOKEN ())
+         if (PREV_TOKEN_TYPE == CPP_BACKSLASH && IMMED_TOKEN ())
            {
-             if (PREV_TOKEN_TYPE == CPP_BACKSLASH)
+             /* Remove the escaped newline.  Then continue to process
+                any interrupted name or number.  */
+             cur_token--;
+             if (IMMED_TOKEN ())
                {
-                 buffer->cur = cur;
-                 cpp_warning (pfile,
-                              "backslash and newline separated by space");
+                 cur_token--;
+                 if (cur_token->type == CPP_NAME)
+                   goto continue_name;
+                 else if (cur_token->type == CPP_NUMBER)
+                   goto continue_number;
+                 cur_token++;
                }
-             PUSH_TOKEN (CPP_VSPACE);
-             goto out;
+             /* Remember whitespace setting.  */
+             flags = cur_token->flags;
+             break;
            }
-         /* Remove the escaped newline.  Then continue to process
-            any interrupted name or number.  */
-         cur_token--;
-         if (IMMED_TOKEN ())
+         if (PREV_TOKEN_TYPE == CPP_BACKSLASH)
            {
-             cur_token--;
-             if (cur_token->type == CPP_NAME)
-               goto continue_name;
-             else if (cur_token->type == CPP_NUMBER)
-               goto continue_number;
-             cur_token++;
+             buffer->cur = cur;
+             cpp_warning (pfile, "backslash and newline separated by space");
            }
-         break;
+         PUSH_TOKEN (CPP_VSPACE);
+         goto out;
 
        case '-':
          if (IMMED_TOKEN () && PREV_TOKEN_TYPE == CPP_MINUS)