Support where clauses for proc groups

This commit is contained in:
gingerBill
2026-06-24 13:31:11 +01:00
parent ead2b9a6e2
commit 859290a9de

View File

@@ -2553,6 +2553,17 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr {
for p.curr_tok.kind != .Close_Brace &&
p.curr_tok.kind != .EOF {
elem := parse_expr(p, false)
if p.curr_tok.kind == .Where {
tok_where := expect_token(p, .Where)
cond := parse_expr(p, false)
be := ast.new(ast.Binary_Expr, elem.pos, end_pos(p.prev_tok))
be.left = elem
be.op = tok_where
be.right = cond
elem = be
}
append(&args, elem)
allow_token(p, .Comma) or_break