* parser-defs.h (prev_lexptr): New external variable.
* parse.c (parse_exp_1): Set prev_lexptr to null before
calling the language-specific parser.
* c-exp.y (yylex): Set prev_lexptr to start of current token.
(yyerror): Use prev_lexptr in error reporting.
+2002-04-24 Michael Snyder <msnyder@redhat.com>
+
+ * parser-defs.h (prev_lexptr): New external variable.
+ * parse.c (parse_exp_1): Set prev_lexptr to null before
+ calling the language-specific parser.
+ * c-exp.y (yylex): Set prev_lexptr to start of current token.
+ (yyerror): Use prev_lexptr in error reporting.
+
2002-04-24 Daniel Jacobowitz <drow@mvista.com>
* config/i386/tm-linux.h: Define FILL_FPXREGSET.
retry:
+ prev_lexptr = lexptr;
unquoted_expr = 1;
tokstart = lexptr;
yyerror (msg)
char *msg;
{
+ if (prev_lexptr)
+ lexptr = prev_lexptr;
+
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
}
union type_stack_elt *type_stack;
int type_stack_depth, type_stack_size;
char *lexptr;
+char *prev_lexptr;
char *namecopy;
int paren_depth;
int comma_terminates;
struct cleanup *old_chain;
lexptr = *stringptr;
+ prev_lexptr = NULL;
paren_depth = 0;
type_stack_depth = 0;
extern char *lexptr;
+/* After a token has been recognized, this variable points to it.
+ Currently used only for error reporting. */
+extern char *prev_lexptr;
+
/* Tokens that refer to names do so with explicit pointer and length,
so they can share the storage that lexptr is parsing.