From dd5f2af2bd4a03b08c8dd33a15a4b86b268a804d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 22 Aug 2005 02:31:10 +0000 Subject: [PATCH] * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:" in yydestruct diagnostic, since it might not be an error. Problem reported by Joel Denny near end of . * data/lalr1cc (yyerturn): Likewise. * data/yacc.c (yyreturn): Likewise. * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change. --- ChangeLog | 18 ++++++++++++++++++ data/glr.c | 4 ++-- data/lalr1.cc | 4 ++-- data/yacc.c | 4 ++-- tests/calc.at | 1 + 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f102faa1..97994210 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2005-08-21 Paul Eggert + * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:" + in yydestruct diagnostic, since it might not be an error. + Problem reported by Joel Denny near end of + . + * data/lalr1cc (yyerturn): Likewise. + * data/yacc.c (yyreturn): Likewise. + * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change. + + * src/files.c: Remove obsolete FIXME comment. + + * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency + with the other templates, and to fix bogus run-on messages such + as the one reported at the end of + . + All callers changed to avoid the newline. + (yyprocessOneStack): Output two lines rather than one, to accommodate + the above change. This changes the debug output format slightly. + * data/glr.c (yyresolveValue): Fix redundant parse tree problem reported by Joel E. Denny in diff --git a/data/glr.c b/data/glr.c index b5b22fdc..2d1cbc42 100644 --- a/data/glr.c +++ b/data/glr.c @@ -2169,7 +2169,7 @@ b4_syncline([@oline@], [@ofile@])])dnl yyreturn: if (yytoken != YYEOF && yytoken != YYEMPTY) - yydestruct ("Error: discarding lookahead", + yydestruct ("Cleanup: discarding lookahead", yytoken, yylvalp]b4_location_if([, yyllocp])[); /* If the stack is well-formed, pop the stack until it is empty, @@ -2183,7 +2183,7 @@ b4_syncline([@oline@], [@ofile@])])dnl { yyGLRState *yys = yystates[0]; ]b4_location_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]] -)[ yydestruct ("Error: popping", +)[ yydestruct ("Cleanup: popping", yystos[yys->yylrState], &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[); yystates[0] = yys->yypred; diff --git a/data/lalr1.cc b/data/lalr1.cc index 7eddaf90..a8e570cc 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -879,11 +879,11 @@ yyabortlab: yyreturn: if (yylooka_ != yyeof_ && yylooka_ != yyempty_) - yydestruct_ ("Error: discarding lookahead", yyilooka_, &yylval, &yylloc); + yydestruct_ ("Cleanup: discarding lookahead", yyilooka_, &yylval, &yylloc); while (yystate_stack_.height () != 1) { - yydestruct_ ("Error: popping", + yydestruct_ ("Cleanup: popping", yystos_[yystate_stack_[0]], &yysemantic_stack_[0], &yylocation_stack_[0]); diff --git a/data/yacc.c b/data/yacc.c index 982747d4..0ba3af88 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -1383,11 +1383,11 @@ yyexhaustedlab: yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Error: discarding lookahead", + yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval]b4_location_if([, &yylloc])[); while (yyssp != yyss) { - yydestruct ("Error: popping", + yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[); YYPOPSTACK; } diff --git a/tests/calc.at b/tests/calc.at index 69b91964..c666dfd3 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -405,6 +405,7 @@ sed '/^Starting/d /^Reducing/d /^Shifting/d /^state/d +/^Cleanup:/d /^Error:/d /^Next/d /^Discarding/d -- 2.47.2