From a8a64ca0fed41c78376b27880e934296bd3c3a7f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 27 Apr 2023 18:20:49 +0200 Subject: Conf: Improve handling of keywords For whatever reason, parser allocated a symbol for every parsed keyword in each scope. That wasted time and memory. The effect is worsened with recent changes allowing local scopes, so keywords often promote soft scopes (with no symbols) to real scopes. Do not allocate a symbol for a keyword. Take care of keywords that could be promoted to symbols (kw_sym) and do it explicitly. --- proto/bgp/config.Y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'proto/bgp') diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index 013d14af..218e0d04 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -46,7 +46,7 @@ CF_KEYWORDS(CEASE, PREFIX, LIMIT, HIT, ADMINISTRATIVE, SHUTDOWN, RESET, PEER, CF_GRAMMAR /* Workaround for collisions between keywords and symbols */ -symbol: ROLE | PEER | PROVIDER | CUSTOMER | RS_SERVER | RS_CLIENT ; +kw_sym: ROLE | PEER | PROVIDER | CUSTOMER | RS_SERVER | RS_CLIENT ; proto: bgp_proto '}' ; -- cgit v1.2.3