summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Weigl-Bosker <stefan@s00.xyz>2024-12-15 10:39:06 -0500
committerStefan Weigl-Bosker <stefan@s00.xyz>2024-12-15 10:39:06 -0500
commit668a93ecfe243b307dcd3cc1c5bc42181e2a3ce8 (patch)
tree4074da17b20f5db57a8e5684531160ac4830bffc /src
parent94b86481395cb2d2a594bb98a1380b9ddc8aa900 (diff)
downloadlg-668a93ecfe243b307dcd3cc1c5bc42181e2a3ce8.tar.gz
fixed issue in character class parsing
Diffstat (limited to 'src')
-rw-r--r--src/regex.zig4
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 };