fix compile errors on stage1

This commit is contained in:
avokadoen
2022-09-01 14:01:34 +02:00
parent 445f3e6b7a
commit 8e45eff185
3 changed files with 7 additions and 6 deletions

View File

@@ -139,7 +139,7 @@ pub const IdRenderer = struct {
self.text_cache.deinit();
}
fn renderSnake(self: *IdRenderer, screaming: bool, id: []const u8, tag: ?[]const u8) !void {
fn renderSnake(self: *IdRenderer, comptime screaming: bool, id: []const u8, tag: ?[]const u8) !void {
var it = SegmentIterator.init(id);
var first = true;
const transform = if (screaming) std.ascii.toUpper else std.ascii.toLower;

View File

@@ -468,12 +468,12 @@ fn parseCommand(allocator: Allocator, elem: *xml.Element) !registry.Declaration
const return_type = try allocator.create(registry.TypeInfo);
return_type.* = command_decl.decl_type.typedef;
const success_codes = if (elem.getAttribute("successcodes")) |codes|
const success_codes: [][]const u8 = if (elem.getAttribute("successcodes")) |codes|
try splitCommaAlloc(allocator, codes)
else
&[_][]const u8{};
const error_codes = if (elem.getAttribute("errorcodes")) |codes|
const error_codes: [][]const u8 = if (elem.getAttribute("errorcodes")) |codes|
try splitCommaAlloc(allocator, codes)
else
&[_][]const u8{};

View File

@@ -56,7 +56,8 @@ pub const Element = struct {
}
pub fn findChildByTag(self: Element, tag: []const u8) ?*Element {
return self.findChildrenByTag(tag).next();
var children = self.findChildrenByTag(tag);
return children.next();
}
pub fn findChildrenByTag(self: Element, tag: []const u8) FindChildrenByTagIterator {
@@ -435,7 +436,7 @@ fn parseElement(parser: *Parser, alloc: Allocator, comptime kind: ElementKind) !
return null;
};
break :blk tag;
}
},
};
var attributes = std.ArrayList(Attribute).init(alloc);
@@ -474,7 +475,7 @@ fn parseElement(parser: *Parser, alloc: Allocator, comptime kind: ElementKind) !
_ = parser.eatWs();
try parser.expect('>');
}
}
},
}
const element = try alloc.create(Element);