authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-03-13 19:38:27 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-03-13 19:38:27 -07:00
log20cd84586cb6f62f15411d47e7e17ef65ef336a3
tree1eaa4a464a437073537125e4d88a03eacf31a56c
parentc767c52ebf1d9ef042e3f17febebbee3582a9339
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

use nprint as new replacement fallback


1 files changed, 1 insertions(+), 8 deletions(-)

src/lib.zig+1-8
...@@ -122,13 +122,6 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val...@@ -122,13 +122,6 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val
122 try writer.print("{d}", .{x});122 try writer.print("{d}", .{x});
123 return;123 return;
124 }124 }
125 if (comptime extras.hasFn("format")(TO)) {
126 return std.fmt.format(writer, "{}", .{x});
127 }
128 if (comptime extras.hasFn("toString")(TO)) {
129 try writer.writeAll(try x.toString(alloc));
130 return;
131 }
132 if (comptime isArrayOf(u8)(TO)) {125 if (comptime isArrayOf(u8)(TO)) {
133 if (repl.raw) {126 if (repl.raw) {
134 try writer.writeAll(&x);127 try writer.writeAll(&x);
...@@ -145,7 +138,7 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val...@@ -145,7 +138,7 @@ fn doInner(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Val
145 if (!opts.escaped) try writer.writeAll(s);138 if (!opts.escaped) try writer.writeAll(s);
146 return;139 return;
147 }140 }
148 @compileError(std.fmt.comptimePrint("pek: print {s}: unsupported type: {s}", .{ v, @typeName(TO) }));141 return x.nprint(writer);
149 },142 },
150 .block => |v| {143 .block => |v| {
151 const body = astgen.Value{ .body = v.body };144 const body = astgen.Value{ .body = v.body };