From 2076b1bd3dfc651cbe4bad90aac9e8a59454ad0a Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 7 Jun 2021 05:33:00 -0700 Subject: [PATCH] util/yaml- add a Sequence type --- src/util/yaml.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/yaml.zig b/src/util/yaml.zig index c0d492f73877fa6dcf937049dab1efa10f6397c3..8728376523967993f7a7ada331cec990176b7727 100644 --- a/src/util/yaml.zig +++ b/src/util/yaml.zig @@ -18,7 +18,7 @@ pub const Item = union(enum) { event: c.yaml_event_t, kv: Key, mapping: Mapping, - sequence: []const Item, + sequence: Sequence, document: Document, string: []const u8, @@ -46,6 +46,8 @@ pub const Item = union(enum) { } }; +pub const Sequence = []const Item; + pub const Key = struct { key: []const u8, value: Value, @@ -54,7 +56,7 @@ pub const Key = struct { pub const Value = union(enum) { string: []const u8, mapping: Mapping, - sequence: []const Item, + sequence: Sequence, pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void { try writer.writeAll("Value{"); -- 2.54.0