aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-05-10 09:11:06 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-05-10 09:11:06 +0000
commitfb4527c3547bcce7b7465adf5164ad1d7aee7745 (patch)
tree809b131b60c8d731244973f0c075e172802ed345 /gcc/cpplex.c
parent62c3ad8bb2e737d1d8ec1db767ce2e8c05bd87b3 (diff)
downloadgcc-fb4527c3547bcce7b7465adf5164ad1d7aee7745.zip
gcc-fb4527c3547bcce7b7465adf5164ad1d7aee7745.tar.gz
gcc-fb4527c3547bcce7b7465adf5164ad1d7aee7745.tar.bz2
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
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 65c4b28..c828eef 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -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)