| ... | @@ -88,6 +88,9 @@ fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value, | ... | @@ -88,6 +88,9 @@ 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("format")(TO)) { |
| | 92 | return std.fmt.format(writer, "{}", .{x}); |
| | 93 | } |
| 91 | if (comptime std.meta.trait.hasFn("toString")(TO)) { | 94 | if (comptime std.meta.trait.hasFn("toString")(TO)) { |
| 92 | try writer.writeAll(try x.toString(alloc)); | 95 | try writer.writeAll(try x.toString(alloc)); |
| 93 | return; | 96 | return; |