From 8d9e9a083d629324aec2cab9aacfd37b47fa9b48 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 1 Dec 2000 22:01:10 +0000 Subject: 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 --- gcc/cpplex.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gcc/cpplex.c') 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; -- cgit v1.1