diff options
Diffstat (limited to 'src/parser.zig')
| -rw-r--r-- | src/parser.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser.zig b/src/parser.zig index 90f16fb..07722d8 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -29,15 +29,15 @@ fn gen(parent: Allocator, l: *Lexer) Error![]const u8 { var elements = try std.ArrayList(Element).initCapacity(alloc, 2); - while (l.nextKind()) |it| { - try elements.append(alloc, switch (it) { + base: while (l.peek()) |it| { + try elements.append(alloc, switch (it.kind) { // block paragraph .literal, .bold, .italic, .code, .link => try paragraph.parse(alloc, l), // other blocks .title => try title.parse(alloc, l), .weak_delimiter, .strong_delimiter => { - _ = l.next(); - continue; + l.consume(); + continue :base; }, else => return Error.FeatureNotSupported, }); |
