aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-02-01 19:13:53 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-02-01 19:13:53 +0000
commitbd9697727ba8f11b7015a5e7e4ab20cd172ddc81 (patch)
treecb3461c1cc22fa95ff3bb51b1b2b2dbad2132830 /gcc/cpplex.c
parent8c0abc88e8dc5593bebe1f4e10b9a545cc183dad (diff)
downloadgcc-bd9697727ba8f11b7015a5e7e4ab20cd172ddc81.zip
gcc-bd9697727ba8f11b7015a5e7e4ab20cd172ddc81.tar.gz
gcc-bd9697727ba8f11b7015a5e7e4ab20cd172ddc81.tar.bz2
cpphash.h (struct cpp_buffer): Move saved_flags from cpp_reader.
* cpphash.h (struct cpp_buffer): Move saved_flags from cpp_reader. * cpplex.c (_cpp_lex_token): New token picks up the saved flags, and AVOID_LPASTE is cleared on meeting an unescaped newline. * cppmacro.c (builtin_macro): Set builtin flags here. (paste_all_tokens): Preserve AVOID_LPASTE on pasted token. (replace_args): Clarify intent. (cpp_get_token): Macro expansion tokens get the saved flags. Update. * cppmain.c (scan_buffer): Remove now-redundant print.printed check. From-SVN: r39393
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index f9431f8..3ff23b4 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -857,7 +857,8 @@ _cpp_lex_token (pfile, result)
done_directive:
buffer = pfile->buffer;
pfile->state.next_bol = 0;
- result->flags = 0;
+ result->flags = buffer->saved_flags;
+ buffer->saved_flags = 0;
next_char:
pfile->lexer_pos.line = buffer->lineno;
next_char2:
@@ -899,7 +900,7 @@ _cpp_lex_token (pfile, result)
/* This is a new line, so clear any white space flag.
Newlines in arguments are white space (6.10.3.10);
parse_arg takes care of that. */
- result->flags &= ~PREV_WHITE;
+ result->flags &= ~(PREV_WHITE | AVOID_LPASTE);
goto next_char;
}
@@ -1196,7 +1197,7 @@ _cpp_lex_token (pfile, result)
/* Get whitespace right - newline_in_args sets it. */
if (pfile->lexer_pos.col == 1)
- result->flags &= ~PREV_WHITE;
+ result->flags &= ~(PREV_WHITE | AVOID_LPASTE);
}
else
{