fix: broken conditionals
This commit is contained in:
parent
b231e66b49
commit
97a43f63eb
33 changed files with 358 additions and 313 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue