Changed the value of EPSILON, so that we can use the NUL character

(which it used to be) in a regex; Also added code to detect escaped
backslashes

Specifically, I replace an escaped backslash with a metacharacter, then
replace it back later on. This prevents problems, like detecting whether
the opening bracket is escaped in '\\[a]'.
This commit is contained in:
2025-01-21 22:10:07 -05:00
parent 0fb78abf7f
commit 25cb79f01b
2 changed files with 13 additions and 1 deletions

2
nfa.go
View File

@@ -4,7 +4,7 @@ import (
"slices"
)
const EPSILON int = 0
const EPSILON int = 0xF0000
type assertType int