diff --git a/src/lib.zig b/src/lib.zig index 44266b36e0eb79a5ab4e681b5f90c6b23774674b..28ca15bbb89b2ea968e08e7f35b2da78d765ff28 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -101,6 +101,10 @@ fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value, }, .@"if" => { comptime assertEqual(v.args.len, 1); + if (comptime std.meta.trait.isIndexable(T)) { + try doif(alloc, writer, body, bottom, data, ctx, indent, flag1, x.len > 0); + return; + } switch (comptime TI) { .Bool => try doif(alloc, writer, body, bottom, data, ctx, indent, flag1, x), .Optional => try docap(alloc, writer, body, bottom, data, ctx, indent, flag1, x),