authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-05-29 03:25:03-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-05-29 03:33:03-04:00
logcd325e408e2d23734ba84e412b6f1706cf442434
treec1ec318cf6c4dac96d1f47ea0fbb58343e401c84
parenteda6898c5b253367174172db909ee23013f32733

zig fmt: fix extra space after comma before multi line string


2 files changed, 13 insertions(+), 0 deletions(-)

std/zig/parser_test.zig+11
...@@ -1,3 +1,14 @@...@@ -1,3 +1,14 @@
1test "zig fmt: 2nd arg multiline string" {
2 try testCanonical(
3 \\comptime {
4 \\ cases.addAsm("hello world linux x86_64",
5 \\ \\.text
6 \\ , "Hello, world!\n");
7 \\}
8 \\
9 );
10}
11
1test "zig fmt: if condition wraps" {12test "zig fmt: if condition wraps" {
2 try testTransform(13 try testTransform(
3 \\comptime {14 \\comptime {
std/zig/render.zig+2
...@@ -1733,6 +1733,8 @@ fn renderToken(tree: &ast.Tree, stream: var, token_index: ast.TokenIndex, indent...@@ -1733,6 +1733,8 @@ fn renderToken(tree: &ast.Tree, stream: var, token_index: ast.TokenIndex, indent
1733 }1733 }
1734 },1734 },
1735 Space.Space, Space.SpaceOrOutdent => {1735 Space.Space, Space.SpaceOrOutdent => {
1736 if (next_token.id == Token.Id.MultilineStringLiteralLine)
1737 return;
1736 try stream.writeByte(' ');1738 try stream.writeByte(' ');
1737 return;1739 return;
1738 },1740 },