summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2018-06-26 14:29:03 +0200
committerJan Maria Matejka <mq@ucw.cz>2018-06-26 14:29:03 +0200
commitf851f0d7e30cbd1e2ba20a5bf06a584acc136828 (patch)
treed9f5b0fb7df29698ed34821d37486e55d4061ace /conf
parent1771f70d7473b8c8e0c6bd47d5c35cc5fbe7eb19 (diff)
Config: Dropping CF_ADDTO.
Diffstat (limited to 'conf')
-rw-r--r--conf/confbase.Y5
-rw-r--r--conf/gen_parser.m411
2 files changed, 4 insertions, 12 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y
index 72f56f1e..8fd72e5e 100644
--- a/conf/confbase.Y
+++ b/conf/confbase.Y
@@ -113,12 +113,13 @@ conf_entries:
| conf_entries conf
;
-CF_ADDTO(conf, ';')
+conf: ';' ;
/* Constant expressions */
-CF_ADDTO(conf, definition)
+conf: definition ;
+
definition:
DEFINE SYM '=' term ';' {
struct f_val *val = cfg_alloc(sizeof(struct f_val));
diff --git a/conf/gen_parser.m4 b/conf/gen_parser.m4
index 00b55023..af43d96f 100644
--- a/conf/gen_parser.m4
+++ b/conf/gen_parser.m4
@@ -34,15 +34,10 @@ m4_define(CF_keywd, `m4_ifdef([[CF_tok_$1]],,[[m4_define([[CF_tok_$1]],1)m4_defi
m4_define(CF_KEYWORDS, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd]], [[$@]])m4_ifelse(CF_toks,,,%token[[]]CF_toks
)DNL')
-# Dynamic syntax rules
-m4_define(CF_dyn_rules,)
-m4_define(CF_ADDTO, `m4_define([[CF_rule_$1]],m4_ifdef([[CF_rule_$1]],CF_rule_$1 | ,[[m4_define([[CF_dyn_rules]],CF_dyn_rules[[CF_RULE($1)
-]])]])$2)DNL')
-
# CLI commands
m4_define(CF_CLI, `m4_define([[CF_cmd]], cmd_[[]]m4_translit($1, [[ ]], _))DNL
m4_divert(2)CF_KEYWORDS(m4_translit($1, [[ ]], [[,]]))
-m4_divert(3)CF_ADDTO(cli_cmd, CF_cmd)
+m4_divert(3)cli_cmd: CF_cmd
CF_cmd: $1 $2 END')
m4_define(CF_CLI_CMD, `')
m4_define(CF_CLI_HELP, `')
@@ -62,10 +57,6 @@ m4_undivert(2)DNL
%%
m4_undivert(3)DNL
-/* Dynamic rules */
-
-m4_define(CF_RULE, [[$1: CF_rule_$1 ;]])
-CF_dyn_rules
%%
m4_undivert(4)DNL
')