[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/6] kinds: use the symbol kinds where applicable
From: |
Akim Demaille |
Subject: |
[PATCH 5/6] kinds: use the symbol kinds where applicable |
Date: |
Sat, 23 May 2020 17:14:44 +0200 |
Instead of generating switch statements with numbers, let's use the
symbol kinds. Not only is this more readable, it also makes reading
diff easier, as a change in symbol numbers won't have such a large
effect on the implementation of symbol actions.
* data/skeletons/bison.m4 (_b4_symbol_case): Use the symbol kind
rather than its number.
---
data/skeletons/bison.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/skeletons/bison.m4 b/data/skeletons/bison.m4
index 2b42d1b5..8c5fbdf5 100644
--- a/data/skeletons/bison.m4
+++ b/data/skeletons/bison.m4
@@ -547,7 +547,7 @@ m4_popdef([b4_actions_])dnl
# easier to use with m4_map, but then, use []dnl to suppress the last
# one.
m4_define([_b4_symbol_case],
-[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])])
+[case b4_symbol([$1], [kind]): b4_symbol_tag_comment([$1])])
])
--
2.26.2
- [PATCH 0/6] Use symbol kinds in symbol actions, Akim Demaille, 2020/05/23
- [PATCH 1/6] tests: show logs, Akim Demaille, 2020/05/23
- [PATCH 2/6] m4: use m4_shift2 etc., Akim Demaille, 2020/05/23
- [PATCH 3/6] m4: simplify useless quotation, Akim Demaille, 2020/05/23
- [PATCH 4/6] kinds: also define the possibly qualified symbol kinds, Akim Demaille, 2020/05/23
- [PATCH 5/6] kinds: use the symbol kinds where applicable,
Akim Demaille <=
- [PATCH 6/6] regen, Akim Demaille, 2020/05/23