mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 07:43:03 +00:00
api.value.type: implement proper support, check, and document
* data/c.m4 (b4_symbol_type_register, b4_type_define_tag) (b4_symbol_value_union, b4_value_type_setup_union) (b4_value_type_setup_variant, b4_value_type_setup): New. (b4_value_type_define): Use it to set up properly the type. Handle the various possible values of api.value.type. * data/c++.m4 (b4_value_type_declare): Likewise. * data/lalr1.cc (b4_value_type_setup_variant): Redefine. * tests/types.at: New. Exercise all the C/C++ skeletons with different types of api.value.type values. * tests/local.mk, tests/testsuite.at: Use it. * doc/bison.texi (%define Summary): Document api.value.type. * NEWS: Advertise it, together with api.token.constructor.
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
|
||||
m4_include(b4_pkgdatadir/[c++.m4])
|
||||
|
||||
# api.value.type=variant is valid.
|
||||
m4_define([b4_value_type_setup_variant])
|
||||
|
||||
# b4_integral_parser_table_declare(TABLE-NAME, CONTENT, COMMENT)
|
||||
# --------------------------------------------------------------
|
||||
@@ -42,9 +44,11 @@ m4_define([b4_integral_parser_table_define],
|
||||
# b4_symbol_value_template(VAL, [TYPE])
|
||||
# -------------------------------------
|
||||
# Same as b4_symbol_value, but used in a template method. It makes
|
||||
# a difference when using variants.
|
||||
# a difference when using variants. Note that b4_value_type_setup_union
|
||||
# overrides b4_symbol_value, so we must override it again.
|
||||
m4_copy([b4_symbol_value], [b4_symbol_value_template])
|
||||
|
||||
m4_append([b4_value_type_setup_union],
|
||||
[m4_copy_force([b4_symbol_value_union], [b4_symbol_value_template])])
|
||||
|
||||
# b4_lhs_value([TYPE])
|
||||
# --------------------
|
||||
|
||||
Reference in New Issue
Block a user