From 31802c6c68a98bdbe34766d3cfdaf65b782851da Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Sun, 3 Jan 2021 13:49:51 -0700 Subject: 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. --- src/value.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/value.zig') 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; -- cgit v1.2.3