summary refs log tree commit diff
path: root/src/tokenizer.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenizer.zig')
-rw-r--r--src/tokenizer.zig2
1 files changed, 2 insertions, 0 deletions
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];