From 58eafb987c7c0a51ec313d23ef06134c005af043 Mon Sep 17 00:00:00 2001 From: Attila Szakacs Date: Wed, 7 Aug 2024 16:09:19 +0200 Subject: [PATCH] filterx/filterx-grammar: factor out expr_plus_generator Signed-off-by: Attila Szakacs --- lib/filterx/filterx-grammar.ym | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/filterx/filterx-grammar.ym b/lib/filterx/filterx-grammar.ym index 0703ec3d8b..d726d41f04 100644 --- a/lib/filterx/filterx-grammar.ym +++ b/lib/filterx/filterx-grammar.ym @@ -120,6 +120,7 @@ construct_template_expr(LogTemplate *template) %type expr_value %type expr_generator %type expr_generator_unchecked +%type expr_plus_generator %type generator_function_call %type function_call %type arguments @@ -370,8 +371,12 @@ expr_generator_unchecked : dict_generator | list_generator | generator_function_call + | expr_plus_generator | '(' expr_generator ')' { $$ = $2; } - | expr '+' expr_generator { $$ = filterx_operator_plus_generator_new($1, $3); } + ; + +expr_plus_generator + : expr '+' expr_generator { $$ = filterx_operator_plus_generator_new($1, $3); } | expr_generator '+' expr { $$ = filterx_operator_plus_generator_new($1, $3); } | expr_generator '+' expr_generator { $$ = filterx_operator_plus_generator_new($1, $3); } ;