From e23cd801c99806dc4056f30fa408ba18636dc9b2 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 5 Dec 2024 16:55:53 +0000 Subject: [PATCH] lang: ast: fix keyword arg parser not inheriting subexpr depth correctly --- lang/ast/expr/arith.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/ast/expr/arith.c b/lang/ast/expr/arith.c index eb548de..1704c32 100644 --- a/lang/ast/expr/arith.c +++ b/lang/ast/expr/arith.c @@ -991,7 +991,12 @@ struct token_parse_result arith_parse_label( msg_expr->s_recipient = expr; msg_expr->s_sub_type = EXPR_SUBTYPE_KEYWORD_MSG; msg_expr->s_type = EXPR_TYPE_ARITH; - msg_expr->s_subexpr_depth = new_parser ? state->s_subexpr_depth + 1 : 0; + msg_expr->s_subexpr_depth = state->s_subexpr_depth; + + if (new_parser) { + msg_expr->s_subexpr_depth++; + } + state = msg_expr; }