mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
m4: provide macros for api.value.type=union
* data/skeletons/bison.m4 (b4_union_if): New. Remove support for "%define variant", which was deprecated long ago. * tests/local.at (AT_UNION_IF): New.
This commit is contained in:
@@ -1132,14 +1132,18 @@ m4_define([b4_parse_error_bmatch],
|
||||
|
||||
|
||||
|
||||
# b4_union_if([IF-UNION-ARE-USED], [IF-NOT])
|
||||
# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
|
||||
# ----------------------------------------------
|
||||
b4_percent_define_if_define([variant])
|
||||
# Depend on whether api.value.type is union, or variant.
|
||||
m4_define([b4_union_flag], [[0]])
|
||||
m4_define([b4_variant_flag], [[0]])
|
||||
b4_percent_define_ifdef([[api.value.type]],
|
||||
[m4_case(b4_percent_define_get_kind([[api.value.type]]), [keyword],
|
||||
[m4_case(b4_percent_define_get([[api.value.type]]), [variant],
|
||||
[m4_define([b4_variant_flag], [[1]])])])])
|
||||
[m4_case(b4_percent_define_get([[api.value.type]]),
|
||||
[union], [m4_define([b4_union_flag], [[1]])],
|
||||
[variant], [m4_define([b4_variant_flag], [[1]])])])])
|
||||
b4_define_flag_if([union])
|
||||
b4_define_flag_if([variant])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user