lalr1.cc: YY_ASSERT should use api.prefix

Working on the previous commit I realized that YY_ASSERT was used in
the generated headers, so must follow api.prefix to avoid clashes when
multiple C++ parser with variants are used.

Actually many more macros should obey api.prefix (YY_CPLUSPLUS,
YY_COPY, etc.).  There was no complaint so far, so it's not urgent
enough for 3.7.4, but it should be addressed in 3.8.

* data/skeletons/variant.hh (b4_assert): New.
Use it.
* tests/local.at (AT_YYLEX_RETURN): Fix.
* tests/headers.at: Make sure variant-based C++ parsers are checked
too.
This test did find that YY_ASSERT escaped renaming (before the fix in
this commit).
This commit is contained in:
Akim Demaille
2020-11-11 11:39:02 +01:00
parent f4431ea115
commit 8b424b865e
4 changed files with 57 additions and 29 deletions

3
NEWS
View File

@@ -15,6 +15,9 @@ GNU Bison NEWS
even when the `parse.assert` %define variable is not enabled. It no
longer does.
The private internal macro YY_ASSERT now obeys the `api.prefix` %define
variable.
** Changes
The YYBISON macro in generated "regular C parsers" (from the "yacc.c"