Commit cd325e408e

Andrew Kelley <superjoe30@gmail.com>
2018-05-29 09:25:03
zig fmt: fix extra space after comma before multi line string
1 parent eda6898
Changed files (2)
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 {
std/zig/render.zig
@@ -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;
             },