Skip to content

Commit

Permalink
filterx/filterx-grammar: set location for generator expressions
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi committed Feb 10, 2025
1 parent 710141a commit 45743a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/filterx/filterx-grammar.ym
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ _assign_location(FilterXExpr *expr, CfgLexer *lexer, CFG_LTYPE *lloc)
%type <node> comparison_operator
%type <node> arithmetic_operator
%type <node> expr_generator
%type <node> expr_generator_unchecked
%type <node> __expr_generator
%type <node> expr_plus_generator
%type <node> generator_function_call
%type <node> function_call
Expand Down Expand Up @@ -469,13 +469,13 @@ expr_value
;

expr_generator
: expr_generator_unchecked {
$$ = $1;
: __expr_generator {
CHECK_ERROR($1, @1, "error initializing generator expression");
$$ = _assign_location($1, lexer, &@1);
}
;

expr_generator_unchecked
__expr_generator
: dict_generator
| list_generator
| generator_function_call
Expand Down

0 comments on commit 45743a4

Please sign in to comment.