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/codegen | |
| 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/codegen')
| -rw-r--r-- | src/codegen/c.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 3de79e2a3d..8c85f482fd 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -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. |
