mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 01:33:03 +00:00
glr.cc: don't issue two error messages when syntax_error is thrown
Reported by Askar Safin. https://lists.gnu.org/archive/html/bison-patches/2019-01/msg00000.html * data/skeletons/glr.c (yygetToken): Return YYEMPTY when an exception is thrown. * data/skeletons/lalr1.cc: Log when an exception is caught. * tests/c++.at (Syntax error as exception): Be sure to recover from error before triggering another error.
This commit is contained in:
@@ -827,6 +827,7 @@ b4_dollar_popdef])[]dnl
|
||||
#if YY_EXCEPTIONS
|
||||
catch (const syntax_error& yyexc)
|
||||
{
|
||||
YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
|
||||
error (yyexc);
|
||||
goto yyerrlab1;
|
||||
}
|
||||
@@ -916,6 +917,7 @@ b4_dollar_popdef])[]dnl
|
||||
#if YY_EXCEPTIONS
|
||||
catch (const syntax_error& yyexc)
|
||||
{
|
||||
YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
|
||||
error (yyexc);
|
||||
YYERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user