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.
This commit is contained in:
committed by
Andrew Kelley
parent
a9b505fa77
commit
31802c6c68
@@ -169,8 +169,8 @@ pub const DeclGen = struct {
|
||||
.undef, .empty_struct_value, .empty_array => try writer.writeAll("{}"),
|
||||
.bytes => {
|
||||
const bytes = val.castTag(.bytes).?.data;
|
||||
// TODO: make our own C string escape instead of using {Z}
|
||||
try writer.print("\"{Z}\"", .{bytes});
|
||||
// TODO: make our own C string escape instead of using std.zig.fmtEscapes
|
||||
try writer.print("\"{}\"", .{std.zig.fmtEscapes(bytes)});
|
||||
},
|
||||
else => {
|
||||
// Fall back to generic implementation.
|
||||
|
||||
Reference in New Issue
Block a user