| ... | @@ -10,8 +10,6 @@ const u = @import("./index.zig"); | ... | @@ -10,8 +10,6 @@ const u = @import("./index.zig"); |
| 10 | // | 10 | // |
| 11 | // | 11 | // |
| 12 | | 12 | |
| 13 | const Array = []const string; | | |
| 14 | | | |
| 15 | pub const Stream = struct { | 13 | pub const Stream = struct { |
| 16 | docs: []const Document, | 14 | docs: []const Document, |
| 17 | }; | 15 | }; |
| ... | @@ -187,7 +185,7 @@ pub fn parse(alloc: *std.mem.Allocator, input: string) !Document { | ... | @@ -187,7 +185,7 @@ pub fn parse(alloc: *std.mem.Allocator, input: string) !Document { |
| 187 | pub const Parser = struct { | 185 | pub const Parser = struct { |
| 188 | alloc: *std.mem.Allocator, | 186 | alloc: *std.mem.Allocator, |
| 189 | tokens: TokenList, | 187 | tokens: TokenList, |
| 190 | lines: Array, | 188 | lines: []const string, |
| 191 | index: usize, | 189 | index: usize, |
| 192 | | 190 | |
| 193 | pub fn parse(self: *Parser) !Stream { | 191 | pub fn parse(self: *Parser) !Stream { |
| ... | @@ -292,7 +290,7 @@ fn parse_sequence(p: *Parser) Error!Sequence { | ... | @@ -292,7 +290,7 @@ fn parse_sequence(p: *Parser) Error!Sequence { |
| 292 | } | 290 | } |
| 293 | } | 291 | } |
| 294 | | 292 | |
| 295 | fn get_event_string(event: Token, lines: Array) string { | 293 | fn get_event_string(event: Token, lines: []const string) string { |
| 296 | const sm = event.start_mark; | 294 | const sm = event.start_mark; |
| 297 | const em = event.end_mark; | 295 | const em = event.end_mark; |
| 298 | return lines[sm.line][sm.column..em.column]; | 296 | return lines[sm.line][sm.column..em.column]; |