mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
I would like to offer new ways to build the error message. As a first step, let's simplify yysyntax_error whose first loop does two things at the same time: (i) collect the tokens to be reported in the error message, and (ii) accumulate their sizes and possibly return "overflow". Let's pull (ii) in a second step. Then test 525 (regression.at:1193: parse.error=verbose overflow) failed. This test checks that we correctly report "memory overflow" when the error message is too large. However the test is mistaken: it is triggered in a place where there are five (large) expected tokens, so anyway we would not display them, so there is no (memory) overflow here! Transform this test to (i) check that indeed there is no overflow, and (ii) create syntax_error3 which does check the intended behavior, but with four expected tokens. * data/skeletons/yacc.c (yysyntax_error): First compute the list of arguments, then compute yysize. * tests/regression.at (parse.error=verbose overflow): Enhance and fix.