lang: ast: fix nested lambdas not parsing correctly

This commit is contained in:
2025-04-20 21:25:28 +01:00
parent 4a258e2580
commit f220fc2f4b

View File

@@ -768,6 +768,14 @@ struct token_parse_result arith_parse_right_bracket(
struct expr_parser_state *state
= parser_get_state(ctx, struct expr_parser_state);
if (expr_terminates_at_token(state, IVY_SYM_RIGHT_BRACKET)) {
state->s_prev_token = IVY_SYM_RIGHT_BRACKET;
struct token_parse_result result
= expr_finalise_and_return(ctx, state);
result.r_flags = PARSE_REPEAT_TOKEN;
return result;
}
if (state->s_prev_token == IVY_SYM_LEFT_BRACKET) {
/* we've just parsed a subscript operator. nothing further to do here. */
return PARSE_RESULT(IVY_OK, 0);