condop_depth--;
break;
+ case CPP_PRAGMA:
+ /* We fell into a pragma. Skip it, and continue. */
+ cp_parser_skip_to_pragma_eol (parser, token);
+ continue;
+
default:
break;
}
++nesting_depth;
break;
+ case CPP_PRAGMA:
+ /* We fell into a pragma. Skip it, and continue or return. */
+ cp_parser_skip_to_pragma_eol (parser, token);
+ if (!nesting_depth)
+ return;
+ continue;
+
default:
break;
}
nesting_depth++;
break;
+ case CPP_PRAGMA:
+ /* Skip it, and continue or return. */
+ cp_parser_skip_to_pragma_eol (parser, token);
+ if (!nesting_depth)
+ return;
+ continue;
+
default:
break;
}
parser->lexer->in_pragma = false;
do
- token = cp_lexer_consume_token (parser->lexer);
- while (token->type != CPP_PRAGMA_EOL && token->type != CPP_EOF);
+ {
+ /* The preprocessor makes sure that a PRAGMA_EOL token appears
+ before an EOF token, even when the EOF is on the pragma line.
+ We should never get here without being inside a deferred
+ pragma. */
+ gcc_checking_assert (cp_lexer_next_token_is_not (parser->lexer, CPP_EOF));
+ token = cp_lexer_consume_token (parser->lexer);
+ }
+ while (token->type != CPP_PRAGMA_EOL);
/* Ensure that the pragma is not parsed again. */
cp_lexer_purge_tokens_after (parser->lexer, pragma_tok);
}
/* Store away all pragma tokens. */
- while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL)
- && cp_lexer_next_token_is_not (parser->lexer, CPP_EOF))
+ while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
cp_lexer_consume_token (parser->lexer);
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
- parser->omp_declare_simd->error_seen = true;
cp_parser_require_pragma_eol (parser, pragma_tok);
struct cp_token_cache *cp
= cp_token_cache_new (pragma_tok, cp_lexer_peek_token (parser->lexer));
{
if (cp == NULL)
{
- while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL)
- && cp_lexer_next_token_is_not (parser->lexer, CPP_EOF))
+ while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
cp_lexer_consume_token (parser->lexer);
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
- goto fail;
cp = cp_token_cache_new (first_token,
cp_lexer_peek_nth_token (parser->lexer,
2));
else /* No optional '( name )'. */
{
/* Store away all pragma tokens. */
- while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL)
- && cp_lexer_next_token_is_not (parser->lexer, CPP_EOF))
+ while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
cp_lexer_consume_token (parser->lexer);
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
- parser->oacc_routine->error_seen = true;
cp_parser_require_pragma_eol (parser, pragma_tok);
struct cp_token_cache *cp
= cp_token_cache_new (pragma_tok, cp_lexer_peek_token (parser->lexer));
if (loc)
*loc = tok->location;
- if (ret == CPP_PRAGMA_EOL || ret == CPP_EOF)
+ if (ret == CPP_PRAGMA_EOL)
ret = CPP_EOF;
else if (ret == CPP_STRING)
*value = cp_parser_string_literal (the_parser, false, false);