mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 23:03:04 +00:00
c: make the token kind definition nicer to read
From
enum gram_tokentype
{
GRAM_EOF = 0,
STRING = 3,
TSTRING = 4,
PERCENT_TOKEN = 5,
To
enum gram_tokentype
{
GRAM_EOF = 0, /* "end of file" */
STRING = 3, /* "string" */
TSTRING = 4, /* "translatable string" */
PERCENT_TOKEN = 5, /* "%token" */
* data/skeletons/bison.m4 (b4_last_enum_token): New.
* data/skeletons/c.m4 (b4_token_enum, b4_token_enums): Show the
corresponding symbol.
This commit is contained in:
@@ -553,8 +553,18 @@ m4_define([b4_any_token_visible_if],
|
||||
m4_define([b4_token_format],
|
||||
[b4_token_visible_if([$2],
|
||||
[m4_format([[$1]],
|
||||
m4_quote(b4_symbol([$2], [id])),
|
||||
m4_quote(b4_symbol([$2], b4_api_token_raw_if([[number]], [[user_number]]))))])])
|
||||
m4_expand(b4_symbol([$2], [id])),
|
||||
m4_expand(b4_symbol([$2], b4_api_token_raw_if([[number]], [[user_number]]))))])])
|
||||
|
||||
|
||||
# b4_last_enum_token
|
||||
# ------------------
|
||||
# The code of the last token visible token.
|
||||
m4_define([_b4_last_enum_token],
|
||||
[b4_token_visible_if([$1],
|
||||
[m4_define([b4_last_enum_token], [$1])])])
|
||||
b4_symbol_foreach([_b4_last_enum_token])
|
||||
|
||||
|
||||
|
||||
## ------- ##
|
||||
|
||||
Reference in New Issue
Block a user