| ... | @@ -88,6 +88,10 @@ fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value, | ... | @@ -88,6 +88,10 @@ fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value, |
| 88 | try writer.print("{d}", .{x}); | 88 | try writer.print("{d}", .{x}); |
| 89 | return; | 89 | return; |
| 90 | } | 90 | } |
| | 91 | if (comptime std.meta.trait.hasFn("toString")(TO)) { |
| | 92 | try writer.writeAll(try x.toString(alloc)); |
| | 93 | return; |
| | 94 | } |
| 91 | @compileError("pek: print: unsupported type: " ++ @typeName(TO)); | 95 | @compileError("pek: print: unsupported type: " ++ @typeName(TO)); |
| 92 | }, | 96 | }, |
| 93 | .block => |v| { | 97 | .block => |v| { |