authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-07 05:33:00 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-07 05:33:00 -07:00
log2076b1bd3dfc651cbe4bad90aac9e8a59454ad0a
treea04fe47665f632634820b78bdf21e9354d2499ca
parent18194d7547479fe30461248675246be8155bb433

util/yaml- add a Sequence type


1 files changed, 4 insertions(+), 2 deletions(-)

src/util/yaml.zig+4-2
......@@ -18,7 +18,7 @@ pub const Item = union(enum) {
1818 event: c.yaml_event_t,
1919 kv: Key,
2020 mapping: Mapping,
21 sequence: []const Item,
21 sequence: Sequence,
2222 document: Document,
2323 string: []const u8,
2424
......@@ -46,6 +46,8 @@ pub const Item = union(enum) {
4646 }
4747};
4848
49pub const Sequence = []const Item;
50
4951pub const Key = struct {
5052 key: []const u8,
5153 value: Value,
......@@ -54,7 +56,7 @@ pub const Key = struct {
5456pub const Value = union(enum) {
5557 string: []const u8,
5658 mapping: Mapping,
57 sequence: []const Item,
59 sequence: Sequence,
5860
5961 pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {
6062 try writer.writeAll("Value{");