| 1 | const std = @import("std"); |
| 2 | const yaml = @import("yaml"); |
| 3 | const nfs = @import("nfs"); |
| 4 | |
| 5 | pub export fn main() void { |
| 6 | var gpa = std.heap.DebugAllocator(.{}){}; |
| 7 | defer std.debug.assert(gpa.deinit() == .ok); |
| 8 | const allocator = gpa.allocator(); |
| 9 | |
| 10 | const stdin = nfs.stdin(); |
| 11 | const input = stdin.readToEndAlloc(allocator, 1024 * 1024, null) catch @panic("too big"); |
| 12 | defer allocator.free(input); |
| 13 | |
| 14 | const doc = yaml.parse(allocator, input) catch return; |
| 15 | defer doc.deinit(allocator); |
| 16 | } |