Xml parser

This commit is contained in:
Robin Voetter
2020-01-05 18:35:30 +01:00
parent b49c64862e
commit 7304493f51
3 changed files with 536 additions and 156 deletions

View File

@@ -1,10 +1,20 @@
const std = @import("std");
const xml = @import("xml.zig");
pub fn main() void {
std.debug.warn("Test\n");
pub fn main() !void {
const file = try std.fs.cwd().openFileC(std.os.argv[1], .{});
defer file.close();
const size = try file.seekableStream().stream.getEndPos();
const source = try std.heap.page_allocator.alloc(u8, size);
defer std.heap.page_allocator.free(source);
_ = try file.inStream().stream.read(source);
var doc = try xml.parse(std.heap.page_allocator, source);
defer doc.deinit();
}
test "main" {
_ = @import("xml.zig");
_ = @import("utf8.zig");
}