Fixed small bug with question mark operator, wasn't adding the empty state's output

master
Aadhavan Srinivasan 2 months ago
parent aee24644e9
commit 84c768fd5e

@ -158,7 +158,7 @@ func thompson(re string) *State {
s2 := &State{}
s2.transitions = make(map[int][]*State)
s2.content = EPSILON
s2.output = make([]*State, 0)
s2.output = append(s2.output, s2)
s2.isEmpty = true
s3 := alternate(s1, s2)
nfa = append(nfa, s3)

Loading…
Cancel
Save