diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-24 20:37:53 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-24 20:43:27 +0200 |
| commit | 22c7aa339407042682eef78f7d1ae1398e1d9b79 (patch) | |
| tree | a7ba615e5a98e32c53e9144e042e6f6a9f3c89d2 /src/content.zig | |
| parent | e7fa254387e450154f03b2d1bdef361a0adb80d1 (diff) | |
perf(lexer): replace nextKind by peek
Diffstat (limited to 'src/content.zig')
| -rw-r--r-- | src/content.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/content.zig b/src/content.zig index e91576d..72acbc7 100644 --- a/src/content.zig +++ b/src/content.zig @@ -31,13 +31,13 @@ pub fn parse(alloc: Allocator, l: *Lexer) Error!Element { fn parseModifier(alloc: Allocator, l: *Lexer, knd: Token.Kind, tag: []const u8) Error!Element { var el = try Element.init(alloc, .content, tag); errdefer el.deinit(); - while (l.nextKind()) |it| { - if (it == knd) { + while (l.peek()) |next| { + if (next.kind == knd) { // consuming the finisher - _ = l.next(); + l.consume(); return el; } - if (it.isDelimiter()) return Error.ModifierNotClosed; + if (next.kind.isDelimiter()) return Error.ModifierNotClosed; try el.appendContent(try parse(alloc, l)); } return Error.ModifierNotClosed; |
