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" {...@@ -69,7 +69,7 @@ test "zig fmt: switch cases trailing comma" {
69 \\ switch (x) {69 \\ switch (x) {
70 \\ 1,2,3 => {},70 \\ 1,2,3 => {},
71 \\ 4,5, => {},71 \\ 4,5, => {},
72 \\ 6...8, => {},72 \\ 6... 8, => {},
73 \\ else => {},73 \\ else => {},
74 \\ }74 \\ }
75 \\}75 \\}
...@@ -79,7 +79,7 @@ test "zig fmt: switch cases trailing comma" {...@@ -79,7 +79,7 @@ test "zig fmt: switch cases trailing comma" {
79 \\ 1, 2, 3 => {},79 \\ 1, 2, 3 => {},
80 \\ 4,80 \\ 4,
81 \\ 5, => {},81 \\ 5, => {},
82 \\ 6 ... 8 => {},82 \\ 6...8 => {},
83 \\ else => {},83 \\ else => {},
84 \\ }84 \\ }
85 \\}85 \\}
...@@ -1091,7 +1091,7 @@ test "zig fmt: switch" {...@@ -1091,7 +1091,7 @@ test "zig fmt: switch" {
1091 \\ 0 => {},1091 \\ 0 => {},
1092 \\ 1 => unreachable,1092 \\ 1 => unreachable,
1093 \\ 2, 3 => {},1093 \\ 2, 3 => {},
1094 \\ 4 ... 7 => {},1094 \\ 4...7 => {},
1095 \\ 1 + 4 * 3 + 22 => {},1095 \\ 1 + 4 * 3 + 22 => {},
1096 \\ else => {1096 \\ else => {
1097 \\ const a = 1;1097 \\ const a = 1;
std/zig/render.zig+1-1
...@@ -244,7 +244,7 @@ fn renderExpression(allocator: &mem.Allocator, stream: var, tree: &ast.Tree, ind...@@ -244,7 +244,7 @@ fn renderExpression(allocator: &mem.Allocator, stream: var, tree: &ast.Tree, ind
244244
245 const op_token = tree.tokens.at(infix_op_node.op_token);245 const op_token = tree.tokens.at(infix_op_node.op_token);
246 const op_space = switch (infix_op_node.op) {246 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,
248 else => Space.Space,248 else => Space.Space,
249 };249 };
250 try renderExpression(allocator, stream, tree, indent, infix_op_node.lhs, op_space);250 try renderExpression(allocator, stream, tree, indent, infix_op_node.lhs, op_space);