Fix a whole bunch of issues exposed by ziglang/zig#9191

This also includes a workaround for the fact that @"type" refers to the builtin
and not to a variable called "type". See ziglang/zig#2897.
This commit is contained in:
Robin Voetter
2021-06-24 02:11:36 +02:00
parent b63533d95b
commit b3c71d69ea
10 changed files with 82 additions and 75 deletions

View File

@@ -74,7 +74,7 @@ fn parseTypes(allocator: *Allocator, out: []registry.Declaration, types_elem: *x
} else if (mem.eql(u8, category, "funcpointer")) {
break :blk try parseFuncPointer(allocator, ty);
} else if (mem.eql(u8, category, "enum")) {
break :blk (try parseEnumAlias(allocator, ty)) orelse continue;
break :blk (try parseEnumAlias(ty)) orelse continue;
}
continue;
@@ -297,7 +297,7 @@ fn parsePointerMeta(fields: Fields, type_info: *registry.TypeInfo, elem: *xml.El
}
}
fn parseEnumAlias(allocator: *Allocator, elem: *xml.Element) !?registry.Declaration {
fn parseEnumAlias(elem: *xml.Element) !?registry.Declaration {
if (elem.getAttribute("alias")) |alias| {
const name = elem.getAttribute("name") orelse return error.InvalidRegistry;
return registry.Declaration{