From c7aa3b422d86b08d76c38af1aa254f192e460b42 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Wed, 23 Apr 2025 10:56:15 +0100 Subject: [PATCH] lang: ast: fix lambdas starting with var declaration not being parsed correctly IVY_KW_VAR is not treated as an expression start token (as variable declarations are not strictly expressions). so the lambda parser did not create a block parser context when it encountered this keyword. --- lang/ast/lambda.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lang/ast/lambda.c b/lang/ast/lambda.c index 979974e..24c0422 100644 --- a/lang/ast/lambda.c +++ b/lang/ast/lambda.c @@ -173,6 +173,9 @@ struct ast_node_type lambda_node_ops = { SYM_PARSER(PIPE, parse_pipe), SYM_PARSER(COLON, parse_colon), }, + .n_keyword_parsers = { + KW_PARSER(VAR, parse_expr_begin), + }, .n_expr_parser = { .expr_begin = parse_expr_begin, },