Adapt to Zig master

This commit is contained in:
Robin Voetter
2021-07-06 10:14:50 +02:00
parent 27c8d4862c
commit ecf3ba4a39
2 changed files with 6 additions and 2 deletions

View File

@@ -61,8 +61,10 @@ pub fn main() !void {
var out_buffer = std.ArrayList(u8).init(allocator);
try generate(allocator, xml_src, out_buffer.writer());
try out_buffer.append(0);
const tree = try std.zig.parse(allocator, out_buffer.items);
const src = out_buffer.items[0 .. out_buffer.items.len - 1 :0];
const tree = try std.zig.parse(allocator, src);
const formatted = try tree.render(allocator);
defer allocator.free(formatted);

View File

@@ -76,8 +76,10 @@ pub const GenerateStep = struct {
var out_buffer = std.ArrayList(u8).init(self.builder.allocator);
try generate(self.builder.allocator, spec, out_buffer.writer());
try out_buffer.append(0);
const tree = try std.zig.parse(self.builder.allocator, out_buffer.items);
const src = out_buffer.items[0 .. out_buffer.items.len - 1 :0];
const tree = try std.zig.parse(self.builder.allocator, src);
var formatted = try tree.render(self.builder.allocator);