diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-10-26 09:20:14 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-10-26 09:20:14 +0000 |
commit | 51e63e60b32911b32d553b3c8fb08ef54212951b (patch) | |
tree | 8b1dcd7ea7fe58c697f075ec9c7cdad1138aaa85 /gcc/cp/parser.c | |
parent | bbdb90f76b20f62039880c986107e57f44ad3995 (diff) | |
download | gcc-51e63e60b32911b32d553b3c8fb08ef54212951b.zip gcc-51e63e60b32911b32d553b3c8fb08ef54212951b.tar.gz gcc-51e63e60b32911b32d553b3c8fb08ef54212951b.tar.bz2 |
c-lex.c (get_nonpadding_token): Remove.
* c-lex.c (get_nonpadding_token): Remove.
(c_lex_with_flags): Push timevar and eat padding here. Improve
stray token diagnostic.
(lex_string): Replace logic with switch statement, eat padding
token here.
* cp/parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
padding token checking.
testsuite:
* gcc.dg/cpp/direct2.c: Adjust expected errors, robustify parser
resyncing.
* gcc.dg/cpp/direct2s.c: Likewise.
From-SVN: r89577
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7109862..fe3b3c6 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -374,30 +374,9 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED , cp_token *token) { static int is_extern_c = 0; - bool done; - done = false; - /* Keep going until we get a token we like. */ - while (!done) - { - /* Get a new token from the preprocessor. */ - token->type = c_lex_with_flags (&token->value, &token->flags); - /* Issue messages about tokens we cannot process. */ - switch (token->type) - { - case CPP_ATSIGN: - case CPP_HASH: - case CPP_PASTE: - error ("invalid token"); - break; - - default: - /* This is a good token, so we exit the loop. */ - done = true; - break; - } - } - /* Now we've got our token. */ + /* Get a new token from the preprocessor. */ + token->type = c_lex_with_flags (&token->value, &token->flags); token->location = input_location; token->in_system_header = in_system_header; |