From: Joel E. Denny Date: Wed, 23 Sep 2009 21:54:04 +0000 (-0400) Subject: yysyntax_error: avoid duplicate lookahead collection. X-Git-Tag: v2.5_rc1~152 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/69a2ab11cf39c253cd6a879915445de18171b739?ds=sidebyside;hp=69a2ab11cf39c253cd6a879915445de18171b739 yysyntax_error: avoid duplicate lookahead collection. Except when memory reallocation is required, this change eliminates the need to invoke yysyntax_error twice and thus to repeat the collection of lookaheads. It also prepares for future extensions that will make those repetitions more expensive and that will require additional memory management in yysyntax_error. Finally, it fixes an obscure bug already exercised in the test suite. * data/yacc.c (yysyntax_error): Add arguments for message buffer variables stored in the parser. Instead of size, return status similar to yyparse status but indicating success of message creation. Other than the actual reallocation of the message buffer, import and clean up memory management code from... (yyparse, yypush_parse): ... here. * tests/regression.at (%error-verbose overflow): No longer an expected failure. (cherry picked from commit 45319f1365eb8d125424f31401d9d33cc02ff4ad) Conflicts: src/parse-gram.c src/parse-gram.h ---