X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/675d9fe4899dc7a2b99d7401a58610b7c63ec1e5..6574576cfb6e5039e8a21714e8d9bf482ae7c32f:/data/lalr1.cc?ds=sidebyside diff --git a/data/lalr1.cc b/data/lalr1.cc index eb488355..4eec878a 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -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]) # -------------------- @@ -824,7 +828,7 @@ b4_dollar_popdef])[]dnl variants. */ b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])],[ /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. Otherwise, use the top of the stack. + '$$ = $1'. Otherwise, use the top of the stack. Otherwise, the following line sets YYLHS.VALUE to garbage. This behavior is undocumented and Bison