From: Ondrej Zajicek Date: Tue, 3 Jun 2025 02:04:47 +0000 (+0200) Subject: Filter: Add 'append' operator X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cdbe42c763bb0af239fe5aa574d1861483ce16a;p=thirdparty%2Fbird.git Filter: Add 'append' operator We need append() operator to concatenate strings / bytestrings. Can be also written as '++', (e.g. "abcd" ++ "1234"). --- diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 0119e1f55..f13b1c12b 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -380,6 +380,7 @@ else: { \&\& return AND; \|\| return OR; \-\> return IMP; +\+\+ return PP; \[\= return PO; \=\] return PC; diff --git a/conf/confbase.Y b/conf/confbase.Y index b2ba3cafb..27c422eab 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -130,7 +130,7 @@ CF_DECLS } %token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT -%token GEQ LEQ NEQ AND OR IMP +%token GEQ LEQ NEQ AND OR IMP PP %token PO PC %token NUM ENUM_TOKEN %token IP4 @@ -158,7 +158,7 @@ CF_DECLS %nonassoc PREFIX_DUMMY %left AND OR %nonassoc '=' '<' '>' '~' GEQ LEQ NEQ NMA IMP PO PC -%left '+' '-' +%left '+' '-' PP %left '*' '/' '%' %left '!' %nonassoc '.' diff --git a/doc/bird.sgml b/doc/bird.sgml index 5f91a8fd4..d981936af 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -1613,17 +1613,21 @@ in the foot). This is a string of characters. There are no ways to modify strings in filters. You can pass them between functions, assign them to variables of type append( function or +