mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
yacc.c: fix #definition of YYEMPTY
When generating a C parser, YYEMPTY is present in enum yytokentype but there is no corresponding #define like there is for the other values. There is a special case for YYEMPTY in b4_token_enums but no corresponding case in b4_token_defines. * data/skeletons/c.m4 (b4_token_defines): Do define YYEMPTY.
This commit is contained in:
committed by
Akim Demaille
parent
98c35e0025
commit
c47bb87f9f
4
NEWS
4
NEWS
@@ -2,6 +2,10 @@ GNU Bison NEWS
|
|||||||
|
|
||||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
In Yacc mode, all the tokens are defined twice: once as an enum, and then
|
||||||
|
as a macro. YYEMPTY was missing its macro.
|
||||||
|
|
||||||
* Noteworthy changes in release 3.7.3 (2020-10-13) [stable]
|
* Noteworthy changes in release 3.7.3 (2020-10-13) [stable]
|
||||||
|
|
||||||
|
|||||||
@@ -509,10 +509,11 @@ m4_define([b4_token_define],
|
|||||||
# ----------------
|
# ----------------
|
||||||
# Output the definition of the tokens.
|
# Output the definition of the tokens.
|
||||||
m4_define([b4_token_defines],
|
m4_define([b4_token_defines],
|
||||||
[b4_any_token_visible_if([/* Token kinds. */
|
[[/* Token kinds. */
|
||||||
m4_join([
|
#define ]b4_symbol([-2], [id])[ -2
|
||||||
|
]m4_join([
|
||||||
], b4_symbol_map([b4_token_define]))
|
], b4_symbol_map([b4_token_define]))
|
||||||
])])
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enum(TOKEN-NUM)
|
# b4_token_enum(TOKEN-NUM)
|
||||||
|
|||||||
Reference in New Issue
Block a user