fix: broken conditionals

This commit is contained in:
Brett Broadhurst 2026-03-30 05:44:35 -06:00
parent b231e66b49
commit 97a43f63eb
Failed to generate hash of commit
33 changed files with 358 additions and 313 deletions

View file

@ -936,19 +936,14 @@ fn parseInlineIf(p: *Parse, main_token: Token, lhs: ?*Ast.Node) Error!?*Ast.Node
.left_brace, .right_brace, .right_arrow,
.glue, .newline, .eof,
};
const scratch_top = p.scratch.items.len;
p.eatToken(.whitespace);
const content_node = try parseContentExpr(p, &token_set);
const end_token = try p.expectToken(.right_brace, true);
if (content_node) |n| try p.scratch.append(p.gpa, n);
const list = try p.nodeListFromScratch(scratch_top, p.scratch.items.len);
return try .createSwitch(p.arena, .if_stmt, .{
return .createBinary(p.arena, .inline_if_stmt, .{
.start = main_token.loc.start,
.end = end_token.loc.end,
}, lhs, list);
}, lhs, content_node);
}
fn parseLbraceExpr(p: *Parse) Error!?*Ast.Node {