From f5140d1027f514bc59d46ab8aa09181f5870afbd Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 13 Dec 2022 19:31:46 +0100 Subject: 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. --- filter/config.Y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'filter') diff --git a/filter/config.Y b/filter/config.Y index e02af182..3bf3a2b6 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -298,12 +298,13 @@ assert_assign(struct f_lval *lval, struct f_inst *expr, const char *start, const CF_DECLS +CF_KEYWORDS_EXCLUSIVE(IN) CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN, ACCEPT, REJECT, ERROR, INT, BOOL, IP, TYPE, PREFIX, RD, PAIR, QUAD, EC, LC, SET, STRING, BYTESTRING, BGPMASK, BGPPATH, CLIST, ECLIST, LCLIST, IF, THEN, ELSE, CASE, - FOR, IN, DO, + FOR, DO, TRUE, FALSE, RT, RO, UNKNOWN, GENERIC, FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, DEST, IFNAME, IFINDEX, WEIGHT, GW_MPLS, ONLINK, PREFERENCE, -- cgit v1.2.3