| ... | @@ -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 }; |