mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
Destructor cleanups and regularization among the three skeletons.
* NEWS: Document the behavior changes. * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the stack before failing, as the cleanup code will do it for us now. * data/lalr1.cc (yyerrlab): Likewise. * data/glr.c (yyparse): Pop everything off the stack before freeing it, so that destructors get called properly. * data/lalr1.cc (yyreturn): Likewise. * data/yacc.c (yyreturn): Pop and destroy the start symbol, too. This is more consistent. * doc/bison.texinfo (Destructor Decl): Mention more reasons why destructors might be called. 1.875 -> 2.1. (Destructor Decl, Decl Summary, Table of Symbols): Some English-language cleanups for %destructor. * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Add output line for destructor of start symbol. * tests/calc.at (AT_CHECK_CALC): Add one to line counts, because of that same extra output line.
This commit is contained in:
@@ -373,6 +373,7 @@ line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
|
||||
sending: EOF (3@30-39)
|
||||
input (0@29-29): /* Nothing */
|
||||
input (2@0-29): line (0@0-29) input (0@29-29)
|
||||
Freeing nterm input (2@0-29)
|
||||
Successful parse.
|
||||
]])
|
||||
|
||||
@@ -391,6 +392,7 @@ line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
|
||||
sending: EOF (3@30-39)
|
||||
input (0@29-29): /* Nothing */
|
||||
input (2@0-29): line (-1@0-29) input (0@29-29)
|
||||
Freeing nterm input (2@0-29)
|
||||
Successful parse.
|
||||
]])
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ _AT_CHECK_CALC([$1],
|
||||
|
||||
2^2^3 = 256
|
||||
(2^2)^3 = 64],
|
||||
[570])
|
||||
[571])
|
||||
|
||||
# Some syntax errors.
|
||||
_AT_CHECK_CALC_ERROR([$1], [1], [0 0], [13],
|
||||
@@ -501,7 +501,7 @@ _AT_CHECK_CALC_ERROR([$1], [1], [/dev/null], [4],
|
||||
#
|
||||
_AT_CHECK_CALC_ERROR([$1], [0],
|
||||
[() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1],
|
||||
[188],
|
||||
[189],
|
||||
[1.1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
|
||||
1.17: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
|
||||
1.22: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
|
||||
@@ -510,10 +510,10 @@ calc: error: 4444 != 1])
|
||||
|
||||
# The same, but this time exercising explicitly triggered syntax errors.
|
||||
# POSIX says the look-ahead causing the error should not be discarded.
|
||||
_AT_CHECK_CALC_ERROR([$1], [0], [(!) + (0 0) = 1], [75],
|
||||
_AT_CHECK_CALC_ERROR([$1], [0], [(!) + (0 0) = 1], [76],
|
||||
[1.9: syntax error, unexpected number
|
||||
calc: error: 2222 != 1])
|
||||
_AT_CHECK_CALC_ERROR([$1], [0], [(- *) + (0 0) = 1], [85],
|
||||
_AT_CHECK_CALC_ERROR([$1], [0], [(- *) + (0 0) = 1], [86],
|
||||
[1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
|
||||
1.11: syntax error, unexpected number
|
||||
calc: error: 2222 != 1])
|
||||
|
||||
Reference in New Issue
Block a user