scritcher/src/printer.zig

15 lines
354 B
Zig
Raw Normal View History

2019-09-10 14:45:04 +00:00
const langs = @import("lang.zig");
pub fn printList(list: langs.CommandList, stream: var) !void {
for (list.items) |cmd| {
const command = @tagName(cmd.tag);
2020-01-15 01:31:20 +00:00
try stream.print("{}", .{command});
2019-09-10 14:45:04 +00:00
for (cmd.args.items) |arg| {
2020-01-15 01:31:20 +00:00
try stream.print(" {}", .{arg});
2019-09-10 14:45:04 +00:00
}
2020-03-26 19:35:58 +00:00
_ = try stream.write(";\n");
2019-09-10 14:45:04 +00:00
}
}