forked from mirror/vulkan-zig
Allow F as floating-point suffix
This commit is contained in:
@@ -89,7 +89,7 @@ fn parseTypes(allocator: *Allocator, out: []registry.Declaration, types_elem: *x
|
|||||||
fn parseForeigntype(ty: *xml.Element) !registry.Declaration {
|
fn parseForeigntype(ty: *xml.Element) !registry.Declaration {
|
||||||
const name = ty.getAttribute("name") orelse return error.InvalidRegistry;
|
const name = ty.getAttribute("name") orelse return error.InvalidRegistry;
|
||||||
const depends = ty.getAttribute("requires") orelse if (mem.eql(u8, name, "int"))
|
const depends = ty.getAttribute("requires") orelse if (mem.eql(u8, name, "int"))
|
||||||
"vk_platform" // for some reason, int doesn't depend on vk_platform (but the other c types do)
|
"vk_platform" // for some reason, int doesn't depend on vk_platform (but the other c types do)
|
||||||
else
|
else
|
||||||
return error.InvalidRegistry;
|
return error.InvalidRegistry;
|
||||||
|
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ fn Renderer(comptime WriterType: type) type {
|
|||||||
try self.writer.print("@as(f32, {s}.{s})", .{tok.text, decimal.text});
|
try self.writer.print("@as(f32, {s}.{s})", .{tok.text, decimal.text});
|
||||||
|
|
||||||
const f = (try tokenizer.next()) orelse return error.InvalidConstantExpr;
|
const f = (try tokenizer.next()) orelse return error.InvalidConstantExpr;
|
||||||
if (f.kind != .id or !mem.eql(u8, f.text, "f")) {
|
if (f.kind != .id or f.text.len != 1 or (f.text[0] != 'f' and f.text[0] != 'F')) {
|
||||||
return error.InvalidApiConstant;
|
return error.InvalidApiConstant;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user