summaryrefslogtreecommitdiff
path: root/data/bison.m4
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny@ces.clemson.edu>2009-04-24 01:42:58 -0400
committerJoel E. Denny <jdenny@ces.clemson.edu>2009-04-24 02:47:22 -0400
commit25029e164a3b2385ae6d95ca4cd19bad36550c92 (patch)
tree00c3a4d4bc382078d0843b8572334c50f28623aa /data/bison.m4
parent620b5727730997767040a023463ce952a0d15ee9 (diff)
downloadbison-25029e164a3b2385ae6d95ca4cd19bad36550c92.tar.gz
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.
Diffstat (limited to 'data/bison.m4')
-rw-r--r--data/bison.m46
1 files changed, 5 insertions, 1 deletions
diff --git a/data/bison.m4 b/data/bison.m4
index f9dd503d..00a42e21 100644
--- a/data/bison.m4
+++ b/data/bison.m4
@@ -499,7 +499,11 @@ m4_define([_b4_percent_define_check_values],
[b4_complain_at(b4_percent_define_get_loc([$1]),
[[invalid value for %%define variable `%s': `%s']],
[$1],
- m4_dquote(m4_indir([b4_percent_define(]$1[)])))])dnl
+ m4_dquote(m4_indir([b4_percent_define(]$1[)])))
+ m4_foreach([b4_value], m4_dquote(m4_shift($@)),
+ [b4_complain_at(b4_percent_define_get_loc([$1]),
+ [[accepted value: `%s']],
+ m4_dquote(b4_value))])])dnl
m4_popdef([b4_good_value])],
[b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])