authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-02-08 13:42:02+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-02-08 15:41:31-08:00
log837cd748a8607a6ac9f1a5bfc6d625512bacb906
tree56d6370309c26dc8d5b8f638846d3ccba8489f17
parentaaf13a2bb369aa5b35d4b5ee36ddd8c6029f7473

zig fmt: fix block lbrace indent


2 files changed, 23 insertions(+), 23 deletions(-)

lib/std/zig/parser_test.zig+22-22
......@@ -2703,28 +2703,28 @@ test "zig fmt: catch" {
27032703 );
27042704}
27052705
2706//test "zig fmt: blocks" {
2707// try testCanonical(
2708// \\test "blocks" {
2709// \\ {
2710// \\ const a = 0;
2711// \\ const b = 0;
2712// \\ }
2713// \\
2714// \\ blk: {
2715// \\ const a = 0;
2716// \\ const b = 0;
2717// \\ }
2718// \\
2719// \\ const r = blk: {
2720// \\ const a = 0;
2721// \\ const b = 0;
2722// \\ };
2723// \\}
2724// \\
2725// );
2726//}
2727//
2706test "zig fmt: blocks" {
2707 try testCanonical(
2708 \\test "blocks" {
2709 \\ {
2710 \\ const a = 0;
2711 \\ const b = 0;
2712 \\ }
2713 \\
2714 \\ blk: {
2715 \\ const a = 0;
2716 \\ const b = 0;
2717 \\ }
2718 \\
2719 \\ const r = blk: {
2720 \\ const a = 0;
2721 \\ const b = 0;
2722 \\ };
2723 \\}
2724 \\
2725 );
2726}
2727
27282728//test "zig fmt: switch" {
27292729// try testCanonical(
27302730// \\test "switch" {
lib/std/zig/render.zig+1-1
......@@ -1768,8 +1768,8 @@ fn renderBlock(
17681768 return renderToken(ais, tree, lbrace + 1, space); // rbrace
17691769 }
17701770
1771 ais.pushIndent();
17721771 try renderToken(ais, tree, lbrace, .Newline);
1772 ais.pushIndent();
17731773 for (statements) |stmt, i| {
17741774 switch (node_tags[stmt]) {
17751775 .GlobalVarDecl => try renderVarDecl(ais, tree, tree.globalVarDecl(stmt)),