authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-05-26 18:10:06-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-05-26 18:10:06-04:00
log7e900d28be00e03eee2ec3703c0c45247b4748b1
tree2436bca67654e0188f7038a577261f0aa7ceaaf2
parent0bef1f98247160cbd5101c763404c76ae287b2bd

zig fmt: no space on switch range operator


2 files changed, 4 insertions(+), 4 deletions(-)

std/zig/parser_test.zig+3-3
......@@ -69,7 +69,7 @@ test "zig fmt: switch cases trailing comma" {
6969 \\ switch (x) {
7070 \\ 1,2,3 => {},
7171 \\ 4,5, => {},
72 \\ 6...8, => {},
72 \\ 6... 8, => {},
7373 \\ else => {},
7474 \\ }
7575 \\}
......@@ -79,7 +79,7 @@ test "zig fmt: switch cases trailing comma" {
7979 \\ 1, 2, 3 => {},
8080 \\ 4,
8181 \\ 5, => {},
82 \\ 6 ... 8 => {},
82 \\ 6...8 => {},
8383 \\ else => {},
8484 \\ }
8585 \\}
......@@ -1091,7 +1091,7 @@ test "zig fmt: switch" {
10911091 \\ 0 => {},
10921092 \\ 1 => unreachable,
10931093 \\ 2, 3 => {},
1094 \\ 4 ... 7 => {},
1094 \\ 4...7 => {},
10951095 \\ 1 + 4 * 3 + 22 => {},
10961096 \\ else => {
10971097 \\ const a = 1;
std/zig/render.zig+1-1
......@@ -244,7 +244,7 @@ fn renderExpression(allocator: &mem.Allocator, stream: var, tree: &ast.Tree, ind
244244
245245 const op_token = tree.tokens.at(infix_op_node.op_token);
246246 const op_space = switch (infix_op_node.op) {
247 ast.Node.InfixOp.Op.Period, ast.Node.InfixOp.Op.ErrorUnion => Space.None,
247 ast.Node.InfixOp.Op.Period, ast.Node.InfixOp.Op.ErrorUnion, ast.Node.InfixOp.Op.Range => Space.None,
248248 else => Space.Space,
249249 };
250250 try renderExpression(allocator, stream, tree, indent, infix_op_node.lhs, op_space);