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:
Todd C. Miller
2020-11-10 07:36:11 +01:00
committed by Akim Demaille
parent 98c35e0025
commit c47bb87f9f
2 changed files with 8 additions and 3 deletions

4
NEWS
View File

@@ -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]

View File

@@ -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)