update: passing allocator to evaluateCondition

This commit is contained in:
Lucas F. 2026-01-14 14:20:56 -03:00
parent c14a92e7ab
commit b93d6f5c81

View file

@ -187,7 +187,7 @@ pub const Renderer = struct {
try writer.writeAll(buf.items);
},
.if_block => {
const condition = self.evaluateCondition(node.@"if".?.condition) catch return false;
const condition = try self.evaluateCondition(alloc, node.@"if".?.condition);
if (condition) {
for (node.@"if".?.true_body) |child| {
@ -232,8 +232,10 @@ pub const Renderer = struct {
try self.renderNode(alloc, nodes, child, writer, &ctx, null);
}
for (node.@"for".?.empty_body) |child| {
try self.renderNode(alloc, nodes, child, writer, &ctx, null);
if (node.@"for".?.body.len == 0) {
for (node.@"for".?.empty_body) |child| {
try self.renderNode(alloc, nodes, child, writer, &ctx, null);
}
}
}
},