| ... | ... | @@ -58,6 +58,7 @@ fn do(writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype |
| 58 | 58 | .replacement => |v| { |
| 59 | 59 | const x = if (comptime std.mem.eql(u8, v[0], "this")) search(v[1..], data) else search(v, ctx); |
| 60 | 60 | const TO = @TypeOf(x); |
| 61 | const TI = @typeInfo(TO); |
| 61 | 62 | |
| 62 | 63 | if (comptime std.meta.trait.isZigString(TO)) { |
| 63 | 64 | const s: []const u8 = x; |
| ... | ... | @@ -70,6 +71,10 @@ fn do(writer: anytype, comptime value: astgen.Value, data: anytype, ctx: anytype |
| 70 | 71 | } |
| 71 | 72 | return; |
| 72 | 73 | } |
| 74 | if (TI == .Int or TI == .Float or TI == .ComptimeInt or TI == .ComptimeFloat) { |
| 75 | try writer.print("{d}", .{x}); |
| 76 | return; |
| 77 | } |
| 73 | 78 | @compileError("pek: print: unsupported type: " ++ @typeName(TO)); |
| 74 | 79 | }, |
| 75 | 80 | .block => |v| { |