diff options
| author | Jonathan Marler <johnnymarler@gmail.com> | 2021-01-03 13:49:51 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-07 23:49:22 -0800 |
| commit | 31802c6c68a98bdbe34766d3cfdaf65b782851da (patch) | |
| tree | 88ea8704da9344e62347bee9b064d4c42cfdec83 /src/value.zig | |
| parent | a9b505fa7774e2e8451bedfa7bea27d7227572e7 (diff) | |
| download | zig-31802c6c68a98bdbe34766d3cfdaf65b782851da.tar.gz zig-31802c6c68a98bdbe34766d3cfdaf65b782851da.zip | |
remove z/Z format specifiers
Zig's format system is flexible enough to add custom formatters. This PR removes the new z/Z format specifiers that were added for printing Zig identifiers and replaces them with custom formatters.
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/value.zig b/src/value.zig index 11c385b446..036e3b71bf 100644 --- a/src/value.zig +++ b/src/value.zig @@ -491,8 +491,8 @@ pub const Value = extern union { val = elem_ptr.array_ptr; }, .empty_array => return out_stream.writeAll(".{}"), - .enum_literal => return out_stream.print(".{z}", .{self.castTag(.enum_literal).?.data}), - .bytes => return out_stream.print("\"{Z}\"", .{self.castTag(.bytes).?.data}), + .enum_literal => return out_stream.print(".{}", .{std.zig.fmtId(self.castTag(.enum_literal).?.data)}), + .bytes => return out_stream.print("\"{}\"", .{std.zig.fmtEscapes(self.castTag(.bytes).?.data)}), .repeated => { try out_stream.writeAll("(repeated) "); val = val.castTag(.repeated).?.data; |
