You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, there is a bug when parsing this template in non-comptime mode {{#a}} {{#b}}{{/b}}{{/a}}
this panics when rendering:
thread 148525 panic: index out of bounds: index 3, len 2
/home/randy/.cache/zig/p/1220897a76b954e9811b760ba8e465d6c2c41ad3f69c8ce30c708e24af8ff12cb182/src/rendering/rendering.zig:1189:62: 0x10a2b0a in levelCapacityHint (codegen)
const section_children = elements[index .. index + section.children_count];
^
/home/randy/.cache/zig/p/1220897a76b954e9811b760ba8e465d6c2c41ad3f69c8ce30c708e24af8ff12cb182/src/rendering/rendering.zig:804:69: 0x10a26fa in render (codegen)
const capacity_hint = self.levelCapacityHint(elements);
^
/home/randy/.cache/zig/p/1220897a76b954e9811b760ba8e465d6c2c41ad3f69c8ce30c708e24af8ff12cb182/src/rendering/rendering.zig:1375:35: 0x10a6758 in bufRender__anon_9310 (codegen)
try data_render.render(template.elements);
^
/home/randy/.cache/zig/p/1220897a76b954e9811b760ba8e465d6c2c41ad3f69c8ce30c708e24af8ff12cb182/src/rendering/rendering.zig:655:31: 0x10a68d6 in internalAllocRender__anon_9309 (codegen)
try RenderEngine.bufRender(list.writer(), template, data, PartialsMap.init(partials));
^
/home/randy/.cache/zig/p/1220897a76b954e9811b760ba8e465d6c2c41ad3f69c8ce30c708e24af8ff12cb182/src/rendering/rendering.zig:148:35: 0x107144c in allocRenderPartialsWithOptions__anon_5943 (codegen)
return try internalAllocRender(allocator, template, partials, data, render_options, null);
^
/home/randy/.cache/zig/p/1220897a76b954e9811b760ba8e465d6c2c41ad3f69c8ce30c708e24af8ff12cb182/src/rendering/rendering.zig:108:46: 0x106151c in allocRender__anon_5440 (codegen)
return try allocRenderPartialsWithOptions(allocator, template, {}, data, .{});
^
it looks like this happens because in parser.zig we omit empty nodes in produceNodes, but if this occurs in a section, we don't update the children_count for the section
the space in the template is empty after trimming whitespace
for (nodes.items) |*node| {
if (!node.text_part.isEmpty()) {
list.appendAssumeCapacity(try self.createElement(node));
}
}
i think an easy fix is to just get rid of this check, unless it's necessary for some reason?
The text was updated successfully, but these errors were encountered:
hi, there is a bug when parsing this template in non-comptime mode
{{#a}} {{#b}}{{/b}}{{/a}}
this panics when rendering:
it looks like this happens because in parser.zig we omit empty nodes in produceNodes, but if this occurs in a section, we don't update the children_count for the section
the space in the template is empty after trimming whitespace
i think an easy fix is to just get rid of this check, unless it's necessary for some reason?
The text was updated successfully, but these errors were encountered: