From 50537e9e67622acff7d40e495f8d106162f3e38e Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 27 Jun 2017 02:34:17 +0200 Subject: bison: permit keywords in list_stmt_expressions 'ct event set label' and 'ct event set new or label' work, but 'ct event set new, label' did not: nft add rule filter input ct event set new,label Error: syntax error, unexpected label This changes the definition to also contain keyword symbol expressions. Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- src/parser_bison.y | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/parser_bison.y b/src/parser_bison.y index ce6a77a8..11f4716a 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -609,8 +609,8 @@ static void location_update(struct location *loc, struct location *rhs, int n) %type rhs_expr concat_rhs_expr basic_rhs_expr %destructor { expr_free($$); } rhs_expr concat_rhs_expr basic_rhs_expr -%type primary_rhs_expr list_rhs_expr shift_rhs_expr -%destructor { expr_free($$); } primary_rhs_expr list_rhs_expr shift_rhs_expr +%type primary_rhs_expr list_rhs_expr shift_rhs_expr symbol_stmt_expr +%destructor { expr_free($$); } primary_rhs_expr list_rhs_expr shift_rhs_expr symbol_stmt_expr %type and_rhs_expr exclusive_or_rhs_expr inclusive_or_rhs_expr %destructor { expr_free($$); } and_rhs_expr exclusive_or_rhs_expr inclusive_or_rhs_expr @@ -3302,14 +3302,17 @@ ct_key_dir_optional : BYTES { $$ = NFT_CT_BYTES; } | ZONE { $$ = NFT_CT_ZONE; } ; +symbol_stmt_expr : symbol_expr + | keyword_expr + ; -list_stmt_expr : symbol_expr COMMA symbol_expr +list_stmt_expr : symbol_stmt_expr COMMA symbol_stmt_expr { $$ = list_expr_alloc(&@$); compound_expr_add($$, $1); compound_expr_add($$, $3); } - | list_stmt_expr COMMA symbol_expr + | list_stmt_expr COMMA symbol_stmt_expr { $1->location = @$; compound_expr_add($1, $3); -- cgit v1.2.3