List accepted values for a %define enum variable with an invalid value.

Suggested by Akim Demaille at
<http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
* data/bison.m4 (_b4_percent_define_check_values): Implement.
* src/muscle-tab.c (muscle_percent_define_check_values): Implement.
* tests/input.at (%define lr.default_reductions invalid values): Merge
into...
(%define enum variables): ... here, and update output.
(cherry picked from commit 25029e164a)
This commit is contained in:
Joel E. Denny
2009-04-24 01:42:58 -04:00
parent 110ef36a1a
commit f49097730e
4 changed files with 53 additions and 35 deletions

View File

@@ -921,38 +921,36 @@ AT_BISON_CHECK([[Input.y]], [1], [],
AT_CLEANUP
## ---------------------------------------------- ##
## %define lr.default_reductions invalid values. ##
## ---------------------------------------------- ##
AT_SETUP([[%define lr.default_reductions invalid values]])
AT_DATA([[input.y]],
[[%define lr.default_reductions "bogus"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [[1]], [[]],
[[input.y:1.9-29: invalid value for %define variable `lr.default_reductions': `bogus'
]])
AT_CLEANUP
## ------------------------ ##
## %define enum variables. ##
## ------------------------ ##
AT_SETUP([[%define enum variables]])
# Front-end.
AT_DATA([[input.y]],
[[%define lr.default_reductions "bogus"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [[1]], [[]],
[[input.y:1.9-29: invalid value for %define variable `lr.default_reductions': `bogus'
input.y:1.9-29: accepted value: `all'
input.y:1.9-29: accepted value: `consistent'
input.y:1.9-29: accepted value: `accepting'
]])
# Back-end.
AT_DATA([[input.y]],
[[%define api.push_pull "neither"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [1], [],
[[input.y:1.9-21: invalid value for %define variable `api.push_pull': `neither'
input.y:1.9-21: accepted value: `pull'
input.y:1.9-21: accepted value: `push'
input.y:1.9-21: accepted value: `both'
]])
AT_CLEANUP