mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 08:43:03 +00:00
In verbose parse error message, don't report `error' as an
expected token. * tests/actions.at (Printers and Destructors): Adjust. * tests/calc.at (Calculator $1): Adjust. * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose error message, do not report the parser accepts the error token in that state.
This commit is contained in:
@@ -500,13 +500,13 @@ yy::b4_name::parse ()
|
||||
{
|
||||
int count = 0;
|
||||
for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x)
|
||||
if (check_[[x + n_]] == x)
|
||||
if (check_[[x + n_]] == x && x != terror_)
|
||||
++count;
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = (n_ < 0 ? -n_ : 0); x < ntokens_ + nnts_; ++x)
|
||||
if (check_[[x + n_]] == x)
|
||||
if (check_[[x + n_]] == x && x != terror_)
|
||||
{
|
||||
message += (!count++) ? ", expecting " : " or ";
|
||||
message += name_[[x]];
|
||||
|
||||
Reference in New Issue
Block a user