Commit fb4527c3 by Neil Booth Committed by Neil Booth

cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag when removing escaped newlines.

        * cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag
        when removing escaped newlines.  Reverse sense of test for
        escaped newline.

From-SVN: r33816
parent 62c3ad8b
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> 2000-05-09 Richard Henderson <rth@cygnus.com>
* flow.c (find_basic_blocks_1): Do not delete the first * flow.c (find_basic_blocks_1): Do not delete the first
......
...@@ -3010,30 +3010,31 @@ _cpp_lex_line (pfile, list) ...@@ -3010,30 +3010,31 @@ _cpp_lex_line (pfile, list)
case '\n': case '\n':
case '\r': case '\r':
handle_newline (cur, buffer->rlimit, c); 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; cur_token--;
cpp_warning (pfile, if (cur_token->type == CPP_NAME)
"backslash and newline separated by space"); goto continue_name;
else if (cur_token->type == CPP_NUMBER)
goto continue_number;
cur_token++;
} }
PUSH_TOKEN (CPP_VSPACE); /* Remember whitespace setting. */
goto out; flags = cur_token->flags;
break;
} }
/* Remove the escaped newline. Then continue to process if (PREV_TOKEN_TYPE == CPP_BACKSLASH)
any interrupted name or number. */
cur_token--;
if (IMMED_TOKEN ())
{ {
cur_token--; buffer->cur = cur;
if (cur_token->type == CPP_NAME) cpp_warning (pfile, "backslash and newline separated by space");
goto continue_name;
else if (cur_token->type == CPP_NUMBER)
goto continue_number;
cur_token++;
} }
break; PUSH_TOKEN (CPP_VSPACE);
goto out;
case '-': case '-':
if (IMMED_TOKEN () && PREV_TOKEN_TYPE == CPP_MINUS) if (IMMED_TOKEN () && PREV_TOKEN_TYPE == CPP_MINUS)
......
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