diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-02-09 22:28:55 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-02-09 22:29:01 -0700 |
| commit | 9d87e6aeb8dd9c46b10483c31a392d7dac8a7dc4 (patch) | |
| tree | cc857e7c1b9dd54f82fd993b834bda7b9f7899c2 | |
| parent | 36eee7bc6cbe6fcc388ebdc38fd3c5f06c9e9043 (diff) | |
| download | zig-9d87e6aeb8dd9c46b10483c31a392d7dac8a7dc4.tar.gz zig-9d87e6aeb8dd9c46b10483c31a392d7dac8a7dc4.zip | |
zig fmt: remove dead code
likely these will be resurrected to make array literal cases pass.
| -rw-r--r-- | lib/std/zig/render.zig | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/std/zig/render.zig b/lib/std/zig/render.zig index 0f922ceb0a..0e9032560c 100644 --- a/lib/std/zig/render.zig +++ b/lib/std/zig/render.zig @@ -2106,38 +2106,3 @@ fn nodeCausesSliceOpSpace(tag: ast.Node.Tag) bool { else => false, }; } - -fn copyFixingWhitespace(ais: *Ais, slice: []const u8) @TypeOf(ais.*).Error!void { - const writer = ais.writer(); - for (slice) |byte| switch (byte) { - '\t' => try writer.writeAll(" "), - '\r' => {}, - else => try writer.writeByte(byte), - }; -} - -// Returns the number of nodes in `expr` that are on the same line as `rtoken`, -// or null if they all are on the same line. -fn rowSize(tree: ast.Tree, exprs: []ast.Node.Index, rtoken: ast.TokenIndex) ?usize { - const first_token = exprs[0].firstToken(); - const first_loc = tree.tokenLocation(tree.token_locs[first_token].start, rtoken); - if (first_loc.line == 0) { - const maybe_comma = tree.prevToken(rtoken); - if (tree.token_tags[maybe_comma] == .Comma) - return 1; - return null; // no newlines - } - - var count: usize = 1; - for (exprs) |expr, i| { - if (i + 1 < exprs.len) { - const expr_last_token = expr.lastToken() + 1; - const loc = tree.tokenLocation(tree.token_locs[expr_last_token].start, exprs[i + 1].firstToken()); - if (loc.line != 0) return count; - count += 1; - } else { - return count; - } - } - unreachable; -} |
