diff --git a/NEWS b/NEWS index ebb3354a..c5775a69 100644 --- a/NEWS +++ b/NEWS @@ -4,9 +4,17 @@ GNU Bison NEWS ** Bug fixes +*** Bug fixes in yacc.c + In Yacc mode, all the tokens are defined twice: once as an enum, and then as a macro. YYEMPTY was missing its macro. +*** Bug fixes in lalr1.cc + + The lalr1.cc skeleton used to emit internal assertions (using YY_ASSERT) + even when the `parse.assert` %define variable is not enabled. It no + longer does. + ** Changes The YYBISON macro in generated "regular C parsers" (from the "yacc.c" diff --git a/data/skeletons/variant.hh b/data/skeletons/variant.hh index 736a2677..1fe40145 100644 --- a/data/skeletons/variant.hh +++ b/data/skeletons/variant.hh @@ -71,12 +71,12 @@ m4_map([ b4_symbol_tag_comment], [$@])dnl # ------------------- # The needed includes for variants support. m4_define([b4_variant_includes], -[b4_parse_assert_if([[#include ]])[ +[b4_parse_assert_if([[#include #ifndef YY_ASSERT # include # define YY_ASSERT assert #endif -]]) +]])]) @@ -110,8 +110,8 @@ m4_define([b4_value_type_declare], template semantic_type (YY_RVREF (T) t)]b4_parse_assert_if([ : yytypeid_ (&typeid (T))])[ - { - YY_ASSERT (sizeof (T) <= size); + {]b4_parse_assert_if([[ + YY_ASSERT (sizeof (T) <= size);]])[ new (yyas_ ()) T (YY_MOVE (t)); } @@ -410,9 +410,6 @@ m4_define([_b4_token_constructor_define], : super_type(]b4_join([token_type (tok)], b4_symbol_if([$1], [has_type], [std::move (v)]), b4_locations_if([std::move (l)]))[) - { - YY_ASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[); - } #else symbol_type (]b4_join( [int tok], @@ -422,10 +419,10 @@ m4_define([_b4_token_constructor_define], : super_type(]b4_join([token_type (tok)], b4_symbol_if([$1], [has_type], [v]), b4_locations_if([l]))[) - { - YY_ASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[); - } #endif + {]b4_parse_assert_if([[ + YY_ASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[); + ]])[} ]])])