From 498632ab5e03f6cafa68fbd6f967e00024e8a0ad Mon Sep 17 00:00:00 2001 From: Baitinq Date: Fri, 10 Jan 2025 00:50:35 +0100 Subject: Tokenizer: Fix parsing end-of-buf strings --- src/tokenizer.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/tokenizer.zig b/src/tokenizer.zig index 688a32f..35da280 100644 --- a/src/tokenizer.zig +++ b/src/tokenizer.zig @@ -44,6 +44,8 @@ pub const Tokenizer = struct { fn consume_string(self: *Tokenizer) []u8 { const start = self.offset; while (true) { + if (self.offset >= self.buf.len) return self.buf[start..self.offset]; + const c = self.buf[self.offset]; if (!std.ascii.isAlphanumeric(c)) return self.buf[start..self.offset]; -- cgit 1.4.1