improve error handling of generator tool

This now also prints more detailed error messages,
similar to the build step.
This commit is contained in:
Robin Voetter
2024-01-06 15:09:04 +01:00
parent 2b6d7691f1
commit cebfcc6045
2 changed files with 65 additions and 38 deletions

View File

@@ -300,7 +300,6 @@ fn lenToPointer(fields: Fields, len: []const u8) std.meta.Tuple(&.{ registry.Poi
}
fn parsePointerMeta(fields: Fields, type_info: *registry.TypeInfo, elem: *xml.Element) !void {
var len_attribute_depth: usize = 0;
if (elem.getAttribute("len")) |lens| {
@@ -327,7 +326,6 @@ fn parsePointerMeta(fields: Fields, type_info: *registry.TypeInfo, elem: *xml.El
}
}
var current_depth: usize = 0;
if (elem.getAttribute("optional")) |optionals| {
@@ -342,8 +340,7 @@ fn parsePointerMeta(fields: Fields, type_info: *registry.TypeInfo, elem: *xml.El
is_already_optional = current_type_info.pointer.is_optional;
current_type_info.pointer.is_optional =
is_already_optional or mem.eql(u8, optional_str, "true");
is_already_optional or mem.eql(u8, optional_str, "true");
} else {
// There is no information for this pointer, probably incorrect.
// Currently there is one definition where this is the case, VkCudaLaunchInfoNV.