]> git.saurik.com Git - bison.git/blobdiff - data/bison.m4
%define variables: support value changes in deprecation
[bison.git] / data / bison.m4
index 03bcc069790ef2123d5765a91f8856b750a9f4f7..26ef5c62d3ac371045cde454b0d5fcc8bd551f7c 100644 (file)
@@ -821,13 +821,12 @@ m4_percent_define_default([[api.token.prefix]], [[]])
 # b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
 # b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
 # b4_token_ctor_if([IF-YYLEX-RETURNS-A-TOKEN], [IF-NOT])
-# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
 # ----------------------------------------------
 b4_percent_define_if_define([token_ctor], [api.token.constructor])
 b4_percent_define_if_define([locations])     # Whether locations are tracked.
 b4_percent_define_if_define([parse.assert])
 b4_percent_define_if_define([parse.trace])
-b4_percent_define_if_define([variant])
+
 
 # b4_bison_locations_if([IF-TRUE])
 # --------------------------------
@@ -854,6 +853,15 @@ b4_define_flag_if([error_verbose])
 b4_error_verbose_if([m4_define([b4_token_table_flag], [1])])
 
 
+# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
+# ----------------------------------------------
+b4_percent_define_if_define([variant])
+m4_case(b4_percent_define_get([[api.value.type]]),
+        [variant], [m4_define([b4_variant_flag], [[1]])],
+                   [m4_define([b4_variant_flag], [[0]])])
+b4_define_flag_if([variant])
+
+
 ## ----------------------------------------------------------- ##
 ## After processing the skeletons, check that all the user's   ##
 ## %define variables and %code qualifiers were used by Bison.  ##