aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-12-01 22:01:10 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-12-01 22:01:10 +0000
commit8d9e9a083d629324aec2cab9aacfd37b47fa9b48 (patch)
treeb2d9610f10a0aa663383569503ef2c3432eb0dd8 /gcc/cpplex.c
parenta717799c527689a0590887bad2d381bf163c29b4 (diff)
downloadgcc-8d9e9a083d629324aec2cab9aacfd37b47fa9b48.zip
gcc-8d9e9a083d629324aec2cab9aacfd37b47fa9b48.tar.gz
gcc-8d9e9a083d629324aec2cab9aacfd37b47fa9b48.tar.bz2
cppinit.c (initialize): Forgotten prototype.
* cppinit.c (initialize): Forgotten prototype. * cpplex.c (_cpp_lex_token): Loop until not skipping. Always clear PREV_WHITE upon meeting a new line. * cpplib.c (end_directive): Set pfile->skipping after skip_rest_of_line. * cpplib.h (cpp_reader): Remove macro_pos. * cppmacro.c (cpp_get_line): Don't do anything special inside macros. (parse_arg): Add PREV_WHITE if a token appears after new lines. (funlike_invocation_p): Save and restore the output position over a successful check for a '('. (enter_macro_context): Delete uses of macro_pos. (cpp_get_token): Don't use pfile->skipping. From-SVN: r37927
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 3cfd8e3..f681830 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -850,8 +850,10 @@ _cpp_lex_token (pfile, result)
cppchar_t c;
cpp_buffer *buffer;
const unsigned char *comment_start;
- unsigned char bol = pfile->state.next_bol;
+ unsigned char bol;
+ skip:
+ bol = pfile->state.next_bol;
done_directive:
buffer = pfile->buffer;
pfile->state.next_bol = 0;
@@ -894,13 +896,10 @@ _cpp_lex_token (pfile, result)
handle_newline (buffer, c);
bol = 1;
pfile->lexer_pos.output_line = buffer->lineno;
-
- /* Newlines in arguments are white space (6.10.3.10).
- Otherwise, clear any white space flag. */
- if (pfile->state.parsing_args)
- result->flags |= PREV_WHITE;
- else
- result->flags &= ~PREV_WHITE;
+ /* 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;
goto next_char;
}
@@ -1276,6 +1275,9 @@ _cpp_lex_token (pfile, result)
break;
}
+ if (pfile->skipping)
+ goto skip;
+
/* If not in a directive, this token invalidates controlling macros. */
if (!pfile->state.in_directive)
pfile->mi_state = MI_FAILED;