@ -128,6 +128,9 @@ func thompson(re string) State {
for i := range s1.output {
s1.output[i].transitions[s1.content] = &s1
}
// Reset output to s1 (in case s1 was a union operator state, which has multiple outputs)
s1.output = nil
s1.output = append(s1.output, &s1)
nfa = append(nfa, s1)
case '|':
s1 := pop(&nfa)
@ -21,6 +21,10 @@ func verifyLastStatesHelper(state *State, visited map[*State]bool) {
state.isLast = true
return
if state.transitions[state.content] == state { // Eg. a*
if visited[state] == true {