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" {...@@ -2703,28 +2703,28 @@ test "zig fmt: catch" {
2703 );2703 );
2704}2704}
27052705
2706//test "zig fmt: blocks" {2706test "zig fmt: blocks" {
2707// try testCanonical(2707 try testCanonical(
2708// \\test "blocks" {2708 \\test "blocks" {
2709// \\ {2709 \\ {
2710// \\ const a = 0;2710 \\ const a = 0;
2711// \\ const b = 0;2711 \\ const b = 0;
2712// \\ }2712 \\ }
2713// \\2713 \\
2714// \\ blk: {2714 \\ blk: {
2715// \\ const a = 0;2715 \\ const a = 0;
2716// \\ const b = 0;2716 \\ const b = 0;
2717// \\ }2717 \\ }
2718// \\2718 \\
2719// \\ const r = blk: {2719 \\ const r = blk: {
2720// \\ const a = 0;2720 \\ const a = 0;
2721// \\ const b = 0;2721 \\ const b = 0;
2722// \\ };2722 \\ };
2723// \\}2723 \\}
2724// \\2724 \\
2725// );2725 );
2726//}2726}
2727//2727
2728//test "zig fmt: switch" {2728//test "zig fmt: switch" {
2729// try testCanonical(2729// try testCanonical(
2730// \\test "switch" {2730// \\test "switch" {
lib/std/zig/render.zig+1-1
...@@ -1768,8 +1768,8 @@ fn renderBlock(...@@ -1768,8 +1768,8 @@ fn renderBlock(
1768 return renderToken(ais, tree, lbrace + 1, space); // rbrace1768 return renderToken(ais, tree, lbrace + 1, space); // rbrace
1769 }1769 }
17701770
1771 ais.pushIndent();
1772 try renderToken(ais, tree, lbrace, .Newline);1771 try renderToken(ais, tree, lbrace, .Newline);
1772 ais.pushIndent();
1773 for (statements) |stmt, i| {1773 for (statements) |stmt, i| {
1774 switch (node_tags[stmt]) {1774 switch (node_tags[stmt]) {
1775 .GlobalVarDecl => try renderVarDecl(ais, tree, tree.globalVarDecl(stmt)),1775 .GlobalVarDecl => try renderVarDecl(ais, tree, tree.globalVarDecl(stmt)),