Skip to content

Commit cd325e4

Browse files
committed
zig fmt: fix extra space after comma before multi line string
1 parent eda6898 commit cd325e4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

std/zig/parser_test.zig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
test "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+
112
test "zig fmt: if condition wraps" {
213
try testTransform(
314
\\comptime {

std/zig/render.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,8 @@ fn renderToken(tree: &ast.Tree, stream: var, token_index: ast.TokenIndex, indent
17331733
}
17341734
},
17351735
Space.Space, Space.SpaceOrOutdent => {
1736+
if (next_token.id == Token.Id.MultilineStringLiteralLine)
1737+
return;
17361738
try stream.writeByte(' ');
17371739
return;
17381740
},

0 commit comments

Comments
 (0)