diff options
author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2024-12-15 10:39:06 -0500 |
---|---|---|
committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2024-12-15 10:39:06 -0500 |
commit | 668a93ecfe243b307dcd3cc1c5bc42181e2a3ce8 (patch) | |
tree | 4074da17b20f5db57a8e5684531160ac4830bffc /src | |
parent | 94b86481395cb2d2a594bb98a1380b9ddc8aa900 (diff) | |
download | lg-668a93ecfe243b307dcd3cc1c5bc42181e2a3ce8.tar.gz |
fixed issue in character class parsing
Diffstat (limited to 'src')
-rw-r--r-- | src/regex.zig | 4 |
1 files changed, 1 insertions, 3 deletions
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 }; |