From: Maria Matejka Date: Fri, 13 Oct 2023 11:46:04 +0000 (+0200) Subject: Merge commit 'f411a19b' into thread-next X-Git-Tag: v3.0.0~387 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdb95c2858fe77d6574803d3557d0f3234a34111;p=thirdparty%2Fbird.git Merge commit 'f411a19b' into thread-next --- cdb95c2858fe77d6574803d3557d0f3234a34111 diff --cc conf/confbase.Y index 9725ef36c,f8d244157..195efff16 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@@ -117,11 -114,16 +117,15 @@@ CF_DECL %type ipa %type net_ip4_ net_ip4 net_ip6_ net_ip6 net_ip_ net_ip net_or_ipa %type net_ net_any net_vpn4_ net_vpn6_ net_vpn_ net_roa4_ net_roa6_ net_roa_ net_ip6_sadr_ net_mpls_ -%type label_stack_start label_stack +%type label_stack_start label_stack %type text opttext + %type bytestring -%type symbol -%type kw_sym +%type symbol symbol_known toksym + %type bytestring_text + %type bytestring_expr + %nonassoc PREFIX_DUMMY %left AND OR %nonassoc '=' '<' '>' '~' GEQ LEQ NEQ NMA PO PC @@@ -408,6 -399,27 +412,27 @@@ opttext | /* empty */ { $$ = NULL; } ; + bytestring: + BYTETEXT - | bytestring_expr { $$ = cf_eval($1, T_BYTESTRING).val.bs; } ++ | bytestring_expr { $$ = cf_eval($1, T_BYTESTRING)->val.bs; } + ; + + bytestring_text: + BYTETEXT { $$.type = T_BYTESTRING; $$.val.bs = $1; } + | TEXT { $$.type = T_STRING; $$.val.s = $1; } + | bytestring_expr { - $$ = cf_eval($1, T_VOID); ++ $$ = *cf_eval($1, T_VOID); + if (($$.type != T_BYTESTRING) && ($$.type != T_STRING)) + cf_error("Bytestring or string value expected"); + } + ; + + bytestring_expr: + symbol_value + | term_bs + | '(' term ')' { $$ = $2; } + ; + CF_CODE