fix: skip mixin definitions in codegen to prevent duplicate rendering
Mixin definitions from included files were being rendered as content. Now generateNode explicitly skips mixin definitions (node.call=false) while still processing expanded mixin calls. Bump version to 0.3.12
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
.{
|
||||
.name = .pugz,
|
||||
.version = "0.3.11",
|
||||
.version = "0.3.12",
|
||||
.fingerprint = 0x822db0790e17621d, // Changing this has security and trust implications.
|
||||
.minimum_zig_version = "0.15.2",
|
||||
.dependencies = .{},
|
||||
|
||||
@@ -190,6 +190,21 @@ pub const Codegen = struct {
|
||||
.Conditional => try self.generateConditional(node),
|
||||
.Each, .EachOf => try self.generateEach(node),
|
||||
.TypeHint => {}, // Skip - processed during field extraction
|
||||
.Mixin => {
|
||||
// Skip mixin definitions (call=false), only process mixin calls (call=true)
|
||||
// Mixin calls should already be expanded by mixin.expandMixins()
|
||||
if (!node.call) return;
|
||||
// If somehow a mixin call wasn't expanded, process its children
|
||||
for (node.nodes.items) |child| {
|
||||
try self.generateNode(child);
|
||||
}
|
||||
},
|
||||
.Include => {
|
||||
// Process included content (children were inlined by processIncludes)
|
||||
for (node.nodes.items) |child| {
|
||||
try self.generateNode(child);
|
||||
}
|
||||
},
|
||||
else => {
|
||||
// Unsupported nodes: skip or process children
|
||||
for (node.nodes.items) |child| {
|
||||
|
||||
Reference in New Issue
Block a user