From 51e07522e8a5fb792b8eb86c9f01910a45f54306 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 17 Apr 2025 21:38:31 +0100 Subject: [PATCH] lang: ast: fix parens not allowing sub-keyword messages previously, an expression like: x arg1:a arg2:(c subArg:d). were being parsed incorrectly. This expression was parsed as single -arg1:arg2:subArg: message being sent to x. the parentheses around the `c subArg:d` sub-expression were being ignored. now, this expression is correcly parsed as the value of `c subArg:d` being passed as a parameter to the message -arg1:arg2: --- lang/ast/expr/arith.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/ast/expr/arith.c b/lang/ast/expr/arith.c index f65e248..8e4d6b0 100644 --- a/lang/ast/expr/arith.c +++ b/lang/ast/expr/arith.c @@ -1276,7 +1276,7 @@ struct token_parse_result arith_parse_label( return PARSE_RESULT(IVY_ERR_BAD_SYNTAX, 0); } - if (expr_terminates_at_token(state, IVY_TOK_LABEL)) { + if (state->s_sub_type == EXPR_SUBTYPE_KEYWORD_ARG) { /* we are currently parsing a keyword or complex message * argument, and have just encountered the label denoting the * next argument. terminate here and propagate this label to the