update to 0.15.0-dev.1518+749f10af4

This commit is contained in:
flut2
2025-08-15 06:48:14 +01:00
parent ed429842b8
commit bed9e2d224
9 changed files with 73 additions and 66 deletions

View File

@@ -439,15 +439,15 @@ fn parseElement(parser: *Parser, alloc: Allocator, comptime kind: ElementKind) !
},
};
var attributes = std.ArrayList(Attribute).init(alloc);
defer attributes.deinit();
var attributes: std.ArrayList(Attribute) = .empty;
defer attributes.deinit(alloc);
var children = std.ArrayList(Content).init(alloc);
defer children.deinit();
var children: std.ArrayList(Content) = .empty;
defer children.deinit(alloc);
while (parser.eatWs()) {
const attr = (try parseAttr(parser, alloc)) orelse break;
try attributes.append(attr);
try attributes.append(alloc, attr);
}
switch (kind) {
@@ -464,7 +464,7 @@ fn parseElement(parser: *Parser, alloc: Allocator, comptime kind: ElementKind) !
}
const content = try parseContent(parser, alloc);
try children.append(content);
try children.append(alloc, content);
}
const closing_tag = try parseNameNoDupe(parser);
@@ -481,8 +481,8 @@ fn parseElement(parser: *Parser, alloc: Allocator, comptime kind: ElementKind) !
const element = try alloc.create(Element);
element.* = .{
.tag = try alloc.dupe(u8, tag),
.attributes = try attributes.toOwnedSlice(),
.children = try children.toOwnedSlice(),
.attributes = try attributes.toOwnedSlice(alloc),
.children = try children.toOwnedSlice(alloc),
};
return element;
}