zig fmt while-else with no blocks
parent
f6c77746d6
commit
405a2390f0
|
@ -3845,6 +3845,7 @@ pub const Parser = struct {
|
|||
ast.Node.Id.Block, ast.Node.Id.If,
|
||||
ast.Node.Id.For, ast.Node.Id.While,
|
||||
ast.Node.Id.Switch => {
|
||||
try stream.print(" ");
|
||||
try stack.append(RenderState { .Expression = else_node.body });
|
||||
},
|
||||
else => {
|
||||
|
@ -4805,6 +4806,11 @@ test "zig fmt: while" {
|
|||
\\ unreachable;
|
||||
\\ };
|
||||
\\
|
||||
\\ const res = while (0 < 10)
|
||||
\\ break 7
|
||||
\\ else
|
||||
\\ unreachable;
|
||||
\\
|
||||
\\ var a: error!u8 = 0;
|
||||
\\ while (a) |v| {
|
||||
\\ a = error.Err;
|
||||
|
|
Loading…
Reference in New Issue