update: include int option for arg in renderNode

This commit is contained in:
Lucas F. 2026-01-14 14:17:57 -03:00
parent 8b36704652
commit 9e1e3c2039

View file

@ -163,7 +163,14 @@ pub const Renderer = struct {
for (node.variable.?.filters) |f| {
const filter_fn = builtin_filters.get(f.name) orelse return error.UnknownFilter;
const arg = if (f.arg) |a| Value{ .string = a } else null;
// const arg = if (f.arg) |a| Value{ .string = a } else null;
var arg: Value = Value.null;
if (f.arg) |a| {
arg = Value{ .string = a };
const result = try std.fmt.parseInt(i64, a, 10);
if (std.math.maxInt(i64) < result) return error.Overflow;
arg = Value{ .int = result };
}
value = try filter_fn(alloc, value, arg);
if (std.mem.eql(u8, f.name, "safe")) is_safe = true;