From 668a93ecfe243b307dcd3cc1c5bc42181e2a3ce8 Mon Sep 17 00:00:00 2001 From: Stefan Weigl-Bosker Date: Sun, 15 Dec 2024 10:39:06 -0500 Subject: fixed issue in character class parsing --- src/regex.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/regex.zig b/src/regex.zig index ed66df8..a2f9c79 100644 --- a/src/regex.zig +++ b/src/regex.zig @@ -76,9 +76,7 @@ pub const Lexer = struct { }, .Class => { while (c != ']') { // needs more verbose error handling - if (self.cursor >= self.regexp.len) { - return Error.EndOfBuffer; - } + c = try self.readChar(); self.cursor += 1; } return .{ .kind = inferred_type, .value = .{ .Class = try RangeList.init(self.regexp[self.start + 1 .. self.cursor - 1], self.allocator) }, .pos = self.start }; -- cgit v1.2.3