Skip to content

Commit

Permalink
zig fmt: fix extra space after comma before multi line string
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed May 29, 2018
1 parent eda6898 commit cd325e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions std/zig/parser_test.zig
@@ -1,3 +1,14 @@
test "zig fmt: 2nd arg multiline string" {
try testCanonical(
\\comptime {
\\ cases.addAsm("hello world linux x86_64",
\\ \\.text
\\ , "Hello, world!\n");
\\}
\\
);
}

test "zig fmt: if condition wraps" {
try testTransform(
\\comptime {
Expand Down
2 changes: 2 additions & 0 deletions std/zig/render.zig
Expand Up @@ -1733,6 +1733,8 @@ fn renderToken(tree: &ast.Tree, stream: var, token_index: ast.TokenIndex, indent
}
},
Space.Space, Space.SpaceOrOutdent => {
if (next_token.id == Token.Id.MultilineStringLiteralLine)
return;
try stream.writeByte(' ');
return;
},
Expand Down

0 comments on commit cd325e4

Please sign in to comment.