zig fmt: switch cases on new lines

See #911
This commit is contained in:
Andrew Kelley 2018-04-12 21:56:12 -04:00
parent 9e701e951b
commit 0f652b4d80

View File

@ -3972,7 +3972,8 @@ pub const Parser = struct {
try stack.append(RenderState { .Expression = items[i] }); try stack.append(RenderState { .Expression = items[i] });
if (i != 0) { if (i != 0) {
try stack.append(RenderState { .Text = ", " }); try stack.append(RenderState.PrintIndent);
try stack.append(RenderState { .Text = ",\n" });
} }
} }
}, },
@ -4878,7 +4879,8 @@ test "zig fmt: switch" {
\\ switch (0) { \\ switch (0) {
\\ 0 => {}, \\ 0 => {},
\\ 1 => unreachable, \\ 1 => unreachable,
\\ 2, 3 => {}, \\ 2,
\\ 3 => {},
\\ 4 ... 7 => {}, \\ 4 ... 7 => {},
\\ 1 + 4 * 3 + 22 => {}, \\ 1 + 4 * 3 + 22 => {},
\\ else => { \\ else => {