fix zig fmt regression
This commit is contained in:
parent
e5ffb94911
commit
28d449b38d
@ -732,7 +732,7 @@ fn parseIfStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
|
|||||||
|
|
||||||
const block_expr = (try parseBlockExpr(arena, it, tree));
|
const block_expr = (try parseBlockExpr(arena, it, tree));
|
||||||
const assign_expr = if (block_expr == null)
|
const assign_expr = if (block_expr == null)
|
||||||
try expectNode(arena, it, tree, parseAdditionExpr, .{
|
try expectNode(arena, it, tree, parseAssignExpr, .{
|
||||||
.ExpectedBlockOrAssignment = .{ .token = it.index },
|
.ExpectedBlockOrAssignment = .{ .token = it.index },
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
|
@ -208,6 +208,16 @@ test "recovery: invalid comptime" {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "zig fmt: if statment" {
|
||||||
|
try testCanonical(
|
||||||
|
\\test "" {
|
||||||
|
\\ if (optional()) |some|
|
||||||
|
\\ bar = some.foo();
|
||||||
|
\\}
|
||||||
|
\\
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
test "zig fmt: top-level fields" {
|
test "zig fmt: top-level fields" {
|
||||||
try testCanonical(
|
try testCanonical(
|
||||||
\\a: did_you_know,
|
\\a: did_you_know,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user