/* Set up static tokens. */
pfile->avoid_paste.type = CPP_PADDING;
pfile->avoid_paste.val.source = NULL;
- pfile->eof.type = CPP_EOF;
- pfile->eof.flags = 0;
+ pfile->avoid_paste.src_loc = 0;
+ pfile->endarg.type = CPP_EOF;
+ pfile->endarg.flags = 0;
+ pfile->endarg.src_loc = 0;
/* Create a token buffer for the lexer. */
_cpp_init_tokenrun (&pfile->base_run, 250);
set to -1 to disable it or to a non-negative value to enable it. */
time_t source_date_epoch;
- /* EOF token, and a token forcing paste avoidance. */
+ /* A token forcing paste avoidance, and one demarking macro arguments. */
cpp_token avoid_paste;
- cpp_token eof;
+ cpp_token endarg;
/* Opaque handle to the dependencies of mkdeps.c. */
class mkdeps *deps;
ntokens--;
arg->count = ntokens;
- set_arg_token (arg, &pfile->eof, pfile->eof.src_loc,
+ /* Append an EOF to mark end-of-argument. */
+ set_arg_token (arg, &pfile->endarg, token->src_loc,
ntokens, MACRO_ARG_TOKEN_NORMAL,
CPP_OPTION (pfile, track_macro_expansion));
return collect_args (pfile, node, pragma_buff, num_args);
}
- /* CPP_EOF can be the end of macro arguments, or the end of the
- file. We mustn't back up over the latter. Ugh. */
- if (token->type != CPP_EOF || token == &pfile->eof)
- {
- /* Back up. We may have skipped padding, in which case backing
- up more than one token when expanding macros is in general
- too difficult. We re-insert it in its own context. */
- _cpp_backup_tokens (pfile, 1);
- if (padding)
- _cpp_push_token_context (pfile, NULL, padding, 1);
- }
+ /* Back up. We may have skipped padding, in which case backing
+ up more than one token when expanding macros is in general
+ too difficult. We re-insert it in its own context. */
+ _cpp_backup_tokens (pfile, 1);
+ if (padding)
+ _cpp_push_token_context (pfile, NULL, padding, 1);
return NULL;
}