mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
fixits: be sure to preserve the action when adding %empty
Currently we remove the rhs to install %empty instead. * src/reader.c (grammar_rule_check_and_complete): Insert the missing %empty in front of the rhs, not in replacement thereof. * tests/actions.at (Add missing %empty): Check that.
This commit is contained in:
@@ -259,6 +259,46 @@ AT_BISON_OPTION_POPDEFS
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
## -------------------- ##
|
||||
## Add missing %empty. ##
|
||||
## -------------------- ##
|
||||
|
||||
AT_SETUP([Add missing %empty])
|
||||
|
||||
AT_DATA([input.y],
|
||||
[[%%
|
||||
exp: a b c d e
|
||||
a: {}
|
||||
b:{
|
||||
};
|
||||
c:
|
||||
d
|
||||
:
|
||||
e:
|
||||
%%
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([--update -Wall input.y], [], [], [ignore])
|
||||
AT_CHECK([cat input.y], [],
|
||||
[[%%
|
||||
exp: a b c d e
|
||||
a: %empty {}
|
||||
b: %empty {
|
||||
};
|
||||
c: %empty @&t@
|
||||
d
|
||||
: %empty @&t@
|
||||
e: %empty @&t@
|
||||
%%
|
||||
]])
|
||||
|
||||
# No warnings.
|
||||
AT_BISON_CHECK([-Wall input.y])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Initial location. ##
|
||||
## ------------------ ##
|
||||
|
||||
Reference in New Issue
Block a user