From: Stan Shebs Date: Thu, 12 May 1994 03:21:48 +0000 (+0000) Subject: Wed May 11 20:11:51 1994 Stan Shebs (shebs@andros.cygnus.com) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8db1a922914c22a21875e5238377dda17d34c21a;p=binutils-gdb.git Wed May 11 20:11:51 1994 Stan Shebs (shebs@andros.cygnus.com) * c-exp.y (yyerror): Display a more informative error message. * ch-exp.y (yyerror): Ditto, don't use global yychar. * m2-exp.y (yyerror): Ditto. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5bf998ade73..8b0176741f6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Wed May 11 20:11:51 1994 Stan Shebs (shebs@andros.cygnus.com) + + * c-exp.y (yyerror): Display a more informative error message. + * ch-exp.y (yyerror): Ditto, don't use global yychar. + * m2-exp.y (yyerror): Ditto. + Tue May 10 11:57:53 1994 Stan Shebs (shebs@andros.cygnus.com) * inflow.c (job_control): Move definition to front of file. diff --git a/gdb/c-exp.y b/gdb/c-exp.y index d559c115d0e..c3befb71e32 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1637,5 +1637,5 @@ void yyerror (msg) char *msg; { - error (msg ? msg : "Invalid syntax in expression."); + error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); } diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y index ded20b5ca93..95259787ff2 100644 --- a/gdb/ch-exp.y +++ b/gdb/ch-exp.y @@ -1989,15 +1989,7 @@ yylex () void yyerror (msg) - char *msg; /* unused */ + char *msg; { - printf_unfiltered ("Parsing: %s\n", lexptr); - if (yychar < 256) - { - error ("Invalid syntax in expression near character '%c'.", yychar); - } - else - { - error ("Invalid syntax in expression"); - } + error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); } diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 0b8961d35e8..bbbdda48f77 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -1152,13 +1152,8 @@ make_qualname(mod,ident) #endif /* 0 */ void -yyerror(msg) - char *msg; /* unused */ +yyerror (msg) + char *msg; { - printf_unfiltered("Parsing: %s\n",lexptr); - if (yychar < 256) - error("Invalid syntax in expression near character '%c'.",yychar); - else - error("Invalid syntax in expression"); + error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); } -