+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * spew.c (last_token_id): New static variable.
+ (read_token): Set it here.
+ (yyerror): Use it here.
+
2001-04-30 Richard Henderson <rth@redhat.com>
* cvt.c: Downcase C_PROMOTING_INTEGER_TYPE_P invocations.
extern char *debug_yytranslate PARAMS ((int));
#endif
static enum cpp_ttype last_token;
+static tree last_token_id;
/* From lex.c: */
/* the declaration found for the last IDENTIFIER token read in.
{
retry:
- last_token = c_lex (&t->yylval.ttype);
+ last_token = c_lex (&last_token_id);
+ t->yylval.ttype = last_token_id;
switch (last_token)
{
error ("%s before numeric constant", string);
else if (last_token == CPP_NAME)
{
- if (yylval.ttype && TREE_CODE (yylval.ttype) == IDENTIFIER_NODE)
- error ("%s before `%s'", string, IDENTIFIER_POINTER (yylval.ttype));
- else
+ if (TREE_CODE (last_token_id) == IDENTIFIER_NODE)
+ error ("%s before `%s'", string, IDENTIFIER_POINTER (last_token_id));
+ else if (ISGRAPH (yychar))
error ("%s before `%c'", string, yychar);
+ else
+ error ("%s before `\%o'", string, yychar);
}
else
error ("%s before `%s' token", string, NAME (last_token));