summaryrefslogtreecommitdiff
path: root/conf/gen_keywords.m4
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2022-12-13 19:31:46 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2023-08-25 23:50:44 +0200
commitf5140d1027f514bc59d46ab8aa09181f5870afbd (patch)
tree0af416202ebde1828b3d0c2684061d600234142b /conf/gen_keywords.m4
parentcce48c6cdd9484c606879ea76d4c633fce12ba36 (diff)
Conf: Allow keywords to be redefined by user symbols
Most syntactic constructs in BIRD configuration (e.g. protocol options) are defined as keywords, which are distinct from symbols (user-defined names for protocols, variables, ...). That may cause backwards compatibility issue when a new feature is added, as it may collide with existing user names. We can allow keywords to be shadowed by symbols in almost all cases to avoid this issue. This replaces the previous mechanism, where shadowable symbols have to be explictly added to kw_syms.
Diffstat (limited to 'conf/gen_keywords.m4')
-rw-r--r--conf/gen_keywords.m41
1 files changed, 1 insertions, 0 deletions
diff --git a/conf/gen_keywords.m4 b/conf/gen_keywords.m4
index 0c1dc545..3206c186 100644
--- a/conf/gen_keywords.m4
+++ b/conf/gen_keywords.m4
@@ -28,6 +28,7 @@ m4_divert(-1)')
m4_define(CF_keywd, `m4_ifdef([[CF_tok_$1]],,[[m4_define([[CF_tok_$1]],1)CF_handle_kw($1)]])')
m4_define(CF_KEYWORDS, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd]], [[$@]])m4_ifelse(CF_toks,,,%token[[]]CF_toks
)DNL')
+m4_define(CF_KEYWORDS_EXCLUSIVE, `CF_KEYWORDS($@)')
# CLI commands generate keywords as well
m4_define(CF_CLI, `CF_KEYWORDS(m4_translit($1, [[ ]], [[,]]))