break;
}
- if (space)
+ if (space && !buffer->pfile->state.lexing_comment)
cpp_warning (buffer->pfile,
"backslash and newline separated by space");
cpp_error (pfile, "attempt to use poisoned \"%s\"", result->name);
/* Constraint 6.10.3.5: __VA_ARGS__ should only appear in the
- replacement list of a variable-arguments macro. */
+ replacement list of a variadic macro. */
if (result == pfile->spec_nodes.n__VA_ARGS__
&& !pfile->state.va_args_ok)
- cpp_pedwarn (pfile, "__VA_ARGS__ can only appear in the expansion of a C99 variable-argument macro");
+ cpp_pedwarn (pfile, "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro");
}
return result;
int leading_period;
{
cpp_buffer *buffer = pfile->buffer;
- cpp_pool *pool = pfile->string_pool;
+ cpp_pool *pool = &pfile->ident_pool;
unsigned char *dest, *limit;
dest = POOL_FRONT (pool);
if (pfile->state.angled_headers)
return 1;
- start = POOL_FRONT (pfile->string_pool);
+ start = POOL_FRONT (&pfile->ident_pool);
/* An odd number of consecutive backslashes represents an escaped
terminator. */
cppchar_t terminator;
{
cpp_buffer *buffer = pfile->buffer;
- cpp_pool *pool = pfile->string_pool;
+ cpp_pool *pool = &pfile->ident_pool;
unsigned char *dest, *limit;
cppchar_t c;
unsigned int nulls = 0;
line, which we don't want to save in the comment. */
if (pfile->buffer->read_ahead != EOF)
len--;
- buffer = _cpp_pool_alloc (pfile->string_pool, len);
+ buffer = _cpp_pool_alloc (&pfile->ident_pool, len);
token->type = CPP_COMMENT;
token->val.str.len = len;
done_directive:
buffer = pfile->buffer;
pfile->state.next_bol = 0;
- result->flags = 0;
+ result->flags = buffer->saved_flags;
+ buffer->saved_flags = 0;
next_char:
pfile->lexer_pos.line = buffer->lineno;
next_char2:
/* 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;
+ result->flags &= ~(PREV_WHITE | AVOID_LPASTE);
goto next_char;
}
buffer->read_ahead = c;
pfile->state.next_bol = 1;
result->type = CPP_EOF;
- break;
+ /* Don't break; pfile->skipping might be true. */
+ return;
case '?':
case '\\':
/* Get whitespace right - newline_in_args sets it. */
if (pfile->lexer_pos.col == 1)
- result->flags &= ~PREV_WHITE;
+ result->flags &= ~(PREV_WHITE | AVOID_LPASTE);
}
else
{
const cpp_token *token;
{
unsigned int len = cpp_token_len (token);
- unsigned char *start = _cpp_pool_alloc (&pfile->temp_string_pool, len), *end;
+ unsigned char *start = _cpp_pool_alloc (&pfile->ident_pool, len), *end;
end = cpp_spell_token (pfile, token, start);
end[0] = '\0';
case CPP_OR: return c == '|';
case CPP_COLON: return c == ':' || c == '>';
case CPP_DEREF: return c == '*';
- case CPP_DOT: return c == '.' || c == '%';
+ case CPP_DOT: return c == '.' || c == '%' || b == CPP_NUMBER;
case CPP_HASH: return c == '#' || c == '%'; /* Digraph form. */
case CPP_NAME: return ((b == CPP_NUMBER
&& name_p (pfile, &token2->val.str))