diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-05-26 18:10:06 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-05-26 18:10:06 -0400 |
| commit | 7e900d28be00e03eee2ec3703c0c45247b4748b1 (patch) | |
| tree | 2436bca67654e0188f7038a577261f0aa7ceaaf2 /std | |
| parent | 0bef1f98247160cbd5101c763404c76ae287b2bd (diff) | |
| download | zig-7e900d28be00e03eee2ec3703c0c45247b4748b1.tar.gz zig-7e900d28be00e03eee2ec3703c0c45247b4748b1.zip | |
zig fmt: no space on switch range operator
Diffstat (limited to 'std')
| -rw-r--r-- | std/zig/parser_test.zig | 6 | ||||
| -rw-r--r-- | std/zig/render.zig | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/std/zig/parser_test.zig b/std/zig/parser_test.zig index e76d588088..dfef594df7 100644 --- a/std/zig/parser_test.zig +++ b/std/zig/parser_test.zig @@ -69,7 +69,7 @@ test "zig fmt: switch cases trailing comma" { \\ switch (x) { \\ 1,2,3 => {}, \\ 4,5, => {}, - \\ 6...8, => {}, + \\ 6... 8, => {}, \\ else => {}, \\ } \\} @@ -79,7 +79,7 @@ test "zig fmt: switch cases trailing comma" { \\ 1, 2, 3 => {}, \\ 4, \\ 5, => {}, - \\ 6 ... 8 => {}, + \\ 6...8 => {}, \\ else => {}, \\ } \\} @@ -1091,7 +1091,7 @@ test "zig fmt: switch" { \\ 0 => {}, \\ 1 => unreachable, \\ 2, 3 => {}, - \\ 4 ... 7 => {}, + \\ 4...7 => {}, \\ 1 + 4 * 3 + 22 => {}, \\ else => { \\ const a = 1; diff --git a/std/zig/render.zig b/std/zig/render.zig index dea06e3a7d..67ec8f7632 100644 --- a/std/zig/render.zig +++ b/std/zig/render.zig @@ -244,7 +244,7 @@ fn renderExpression(allocator: &mem.Allocator, stream: var, tree: &ast.Tree, ind const op_token = tree.tokens.at(infix_op_node.op_token); const op_space = switch (infix_op_node.op) { - ast.Node.InfixOp.Op.Period, ast.Node.InfixOp.Op.ErrorUnion => Space.None, + ast.Node.InfixOp.Op.Period, ast.Node.InfixOp.Op.ErrorUnion, ast.Node.InfixOp.Op.Range => Space.None, else => Space.Space, }; try renderExpression(allocator, stream, tree, indent, infix_op_node.lhs, op_space); |
