| ... | @@ -18,7 +18,7 @@ pub const Item = union(enum) { | ... | @@ -18,7 +18,7 @@ pub const Item = union(enum) { |
| 18 | event: c.yaml_event_t, | 18 | event: c.yaml_event_t, |
| 19 | kv: Key, | 19 | kv: Key, |
| 20 | mapping: Mapping, | 20 | mapping: Mapping, |
| 21 | sequence: []const Item, | 21 | sequence: Sequence, |
| 22 | document: Document, | 22 | document: Document, |
| 23 | string: []const u8, | 23 | string: []const u8, |
| 24 | | 24 | |
| ... | @@ -46,6 +46,8 @@ pub const Item = union(enum) { | ... | @@ -46,6 +46,8 @@ pub const Item = union(enum) { |
| 46 | } | 46 | } |
| 47 | }; | 47 | }; |
| 48 | | 48 | |
| | 49 | pub const Sequence = []const Item; |
| | 50 | |
| 49 | pub const Key = struct { | 51 | pub const Key = struct { |
| 50 | key: []const u8, | 52 | key: []const u8, |
| 51 | value: Value, | 53 | value: Value, |
| ... | @@ -54,7 +56,7 @@ pub const Key = struct { | ... | @@ -54,7 +56,7 @@ pub const Key = struct { |
| 54 | pub const Value = union(enum) { | 56 | pub const Value = union(enum) { |
| 55 | string: []const u8, | 57 | string: []const u8, |
| 56 | mapping: Mapping, | 58 | mapping: Mapping, |
| 57 | sequence: []const Item, | 59 | sequence: Sequence, |
| 58 | | 60 | |
| 59 | pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void { | 61 | pub fn format(self: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void { |
| 60 | try writer.writeAll("Value{"); | 62 | try writer.writeAll("Value{"); |