Commit 837cd748a8
Changed files (2)
lib
std
lib/std/zig/parser_test.zig
@@ -2703,28 +2703,28 @@ test "zig fmt: catch" {
);
}
-//test "zig fmt: blocks" {
-// try testCanonical(
-// \\test "blocks" {
-// \\ {
-// \\ const a = 0;
-// \\ const b = 0;
-// \\ }
-// \\
-// \\ blk: {
-// \\ const a = 0;
-// \\ const b = 0;
-// \\ }
-// \\
-// \\ const r = blk: {
-// \\ const a = 0;
-// \\ const b = 0;
-// \\ };
-// \\}
-// \\
-// );
-//}
-//
+test "zig fmt: blocks" {
+ try testCanonical(
+ \\test "blocks" {
+ \\ {
+ \\ const a = 0;
+ \\ const b = 0;
+ \\ }
+ \\
+ \\ blk: {
+ \\ const a = 0;
+ \\ const b = 0;
+ \\ }
+ \\
+ \\ const r = blk: {
+ \\ const a = 0;
+ \\ const b = 0;
+ \\ };
+ \\}
+ \\
+ );
+}
+
//test "zig fmt: switch" {
// try testCanonical(
// \\test "switch" {
lib/std/zig/render.zig
@@ -1768,8 +1768,8 @@ fn renderBlock(
return renderToken(ais, tree, lbrace + 1, space); // rbrace
}
- ais.pushIndent();
try renderToken(ais, tree, lbrace, .Newline);
+ ais.pushIndent();
for (statements) |stmt, i| {
switch (node_tags[stmt]) {
.GlobalVarDecl => try renderVarDecl(ais, tree, tree.globalVarDecl(stmt)),