diff options
-rw-r--r-- | src/parser_bison.y | 12 | ||||
-rw-r--r-- | src/statement.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 8a7785b3..76cf65cb 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1765,17 +1765,17 @@ set_stmt_op : ADD { $$ = NFT_DYNSET_OP_ADD; } | UPDATE { $$ = NFT_DYNSET_OP_UPDATE; } ; -flow_stmt : flow_stmt_alloc flow_stmt_opts flow_key_expr stmt +flow_stmt : flow_stmt_alloc flow_stmt_opts '{' flow_key_expr stmt '}' { - $1->flow.key = $3; - $1->flow.stmt = $4; + $1->flow.key = $4; + $1->flow.stmt = $5; $$->location = @$; $$ = $1; } - | flow_stmt_alloc flow_key_expr stmt + | flow_stmt_alloc '{' flow_key_expr stmt '}' { - $1->flow.key = $2; - $1->flow.stmt = $3; + $1->flow.key = $3; + $1->flow.stmt = $4; $$->location = @$; $$ = $1; } diff --git a/src/statement.c b/src/statement.c index 988cfeb7..76f528b3 100644 --- a/src/statement.c +++ b/src/statement.c @@ -112,9 +112,11 @@ static void flow_stmt_print(const struct stmt *stmt) expr_print(stmt->flow.set); printf(" "); } + printf("{ "); expr_print(stmt->flow.key); printf(" "); stmt_print(stmt->flow.stmt); + printf("} "); } static void flow_stmt_destroy(struct stmt *stmt) |