diff --git a/nfa.go b/nfa.go index 0d45cfa..66b09ce 100644 --- a/nfa.go +++ b/nfa.go @@ -333,3 +333,12 @@ func newState() State { ret.output = append(ret.output, &ret) return ret } + +// Creates and returns a state that _always_ has a zero-length match. +func zeroLengthMatchState() State { + start := newState() + start.content = newContents(EPSILON) + start.isEmpty = true + start.assert = ALWAYS_TRUE + return start +}