From af8945424dfb7ebd52a32f111736481d0c0e75c9 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 17 Apr 2024 09:45:16 +0200 Subject: [PATCH] Fix confusing yacc rule names --- internal/filter/parser.y | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/filter/parser.y b/internal/filter/parser.y index df60b4d8..66d989ed 100644 --- a/internal/filter/parser.y +++ b/internal/filter/parser.y @@ -75,8 +75,8 @@ func reduceFilter(left Filter, op string, right Filter) Filter { } %type filter_rule +%type filter_chain_list %type filter_chain -%type conditions_expr %type maybe_negated_condition_expr %type condition_expr %type exists_expr @@ -100,7 +100,7 @@ func reduceFilter(left Filter, op string, right Filter) Filter { %type "!" // This is just used for declaring explicit precedence and resolves shift/reduce conflicts -// in `filter_chain` and `conditions_expr` rules. +// in `filter_chain_list` and `filter_chain` rules. %nonassoc PREFER_SHIFTING_LOGICAL_OP %nonassoc T_EQUAL T_UNEQUAL T_LIKE T_UNLIKE @@ -113,30 +113,30 @@ func reduceFilter(left Filter, op string, right Filter) Filter { %% -filter_rule: filter_chain logical_op filter_chain +filter_rule: filter_chain_list logical_op filter_chain_list { $$ = reduceFilter($1, $2, $3) yylex.(*Lexer).rule = $$ } - | filter_chain %prec PREFER_SHIFTING_LOGICAL_OP + | filter_chain_list %prec PREFER_SHIFTING_LOGICAL_OP { yylex.(*Lexer).rule = $$ } - | filter_rule logical_op filter_chain + | filter_rule logical_op filter_chain_list { $$ = reduceFilter($1, $2, $3) yylex.(*Lexer).rule = $$ } ; -filter_chain: conditions_expr logical_op maybe_negated_condition_expr +filter_chain_list: filter_chain logical_op maybe_negated_condition_expr { $$ = reduceFilter($1, $2, $3) } - | conditions_expr %prec PREFER_SHIFTING_LOGICAL_OP + | filter_chain %prec PREFER_SHIFTING_LOGICAL_OP ; -conditions_expr: maybe_negated_condition_expr logical_op maybe_negated_condition_expr +filter_chain: maybe_negated_condition_expr logical_op maybe_negated_condition_expr { $$ = reduceFilter($1, $2, $3) }