summaryrefslogtreecommitdiff
path: root/conf/gen_parser.m4
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-02 20:29:03 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-09-12 15:20:50 +0200
commit8e177cf35b582ec973c1abce4709c80847adb711 (patch)
treefcf14a0c11d2ae7d5ae67229c658d579e61c32fc /conf/gen_parser.m4
parenta5a6de581b79641b21b26277580cb4cc118da7ea (diff)
Conf: Symbol hashes for all scopes
This is a backport cherry-pick of commits 165156beeb2926472bbceca3c103aacc3f81a8cc cce974e8ea992d0e6d2f649eca7880b436d91d71 from the v3.0 branch as we need symbol hashes directly inside their scopes for more general usage than before.
Diffstat (limited to 'conf/gen_parser.m4')
-rw-r--r--conf/gen_parser.m48
1 files changed, 4 insertions, 4 deletions
diff --git a/conf/gen_parser.m4 b/conf/gen_parser.m4
index a26af851..caf22307 100644
--- a/conf/gen_parser.m4
+++ b/conf/gen_parser.m4
@@ -31,13 +31,13 @@ m4_define(CF_iterate, `m4_define([[CF_iter]], m4_defn([[$1]]))CF_itera($2)')
m4_define(CF_append, `m4_define([[$1]], m4_ifdef([[$1]], m4_defn([[$1]])[[$3]])[[$2]])')
-# Keywords act as %token<kw>
+# Keywords act as %token<s>
m4_define(CF_keywd, `m4_ifdef([[CF_tok_$1]],,[[m4_define([[CF_tok_$1]],1)CF_append([[CF_kw_rule]],$1,[[ | ]])m4_define([[CF_toks]],CF_toks $1)]])')
-m4_define(CF_KEYWORDS, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd]], [[$@]])m4_ifelse(CF_toks,,,%token<kw>[[]]CF_toks
+m4_define(CF_KEYWORDS, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd]], [[$@]])m4_ifelse(CF_toks,,,%token<s>[[]]CF_toks
)DNL')
m4_define(CF_keywd2, `m4_ifdef([[CF_tok_$1]],,[[m4_define([[CF_tok_$1]],1)m4_define([[CF_toks]],CF_toks $1)]])')
-m4_define(CF_KEYWORDS_EXCLUSIVE, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd2]], [[$@]])m4_ifelse(CF_toks,,,%token<kw>[[]]CF_toks
+m4_define(CF_KEYWORDS_EXCLUSIVE, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd2]], [[$@]])m4_ifelse(CF_toks,,,%token<s>[[]]CF_toks
)DNL')
# CLI commands
@@ -61,7 +61,7 @@ m4_undivert(1)DNL
m4_undivert(2)DNL
-%type <kw> KEYWORD
+%type <s> KEYWORD
%%
KEYWORD: CF_kw_rule;