Fixed small bug with question mark operator, wasn't adding the empty state's output
This commit is contained in:
2
main.go
2
main.go
@@ -158,7 +158,7 @@ func thompson(re string) *State {
|
|||||||
s2 := &State{}
|
s2 := &State{}
|
||||||
s2.transitions = make(map[int][]*State)
|
s2.transitions = make(map[int][]*State)
|
||||||
s2.content = EPSILON
|
s2.content = EPSILON
|
||||||
s2.output = make([]*State, 0)
|
s2.output = append(s2.output, s2)
|
||||||
s2.isEmpty = true
|
s2.isEmpty = true
|
||||||
s3 := alternate(s1, s2)
|
s3 := alternate(s1, s2)
|
||||||
nfa = append(nfa, s3)
|
nfa = append(nfa, s3)
|
||||||
|
Reference in New Issue
Block a user