From aee24644e9a5337ef141d1d8400f53f80c965e23 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Mon, 28 Oct 2024 09:39:37 -0400 Subject: [PATCH] Use new unique_append function signature --- nfa.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nfa.go b/nfa.go index 4e7cba3..233a5cb 100644 --- a/nfa.go +++ b/nfa.go @@ -55,7 +55,7 @@ func verifyLastStates(start []*State) { func concatenate(s1 *State, s2 *State) *State { for i := range s1.output { - s1.output[i].transitions[s2.content] = unique_append(s1.output[i].transitions[s2.content], s2) + s1.output[i].transitions[s2.content], _ = unique_append(s1.output[i].transitions[s2.content], s2) } s1.output = s2.output return s1 @@ -69,9 +69,9 @@ func kleene(s1 State) *State { toReturn.isKleene = true toReturn.output = append(toReturn.output, toReturn) for i := range s1.output { - s1.output[i].transitions[toReturn.content] = unique_append(s1.output[i].transitions[toReturn.content], toReturn) + s1.output[i].transitions[toReturn.content], _ = unique_append(s1.output[i].transitions[toReturn.content], toReturn) } - toReturn.transitions[s1.content] = unique_append(toReturn.transitions[s1.content], &s1) + toReturn.transitions[s1.content], _ = unique_append(toReturn.transitions[s1.content], &s1) return toReturn } @@ -85,8 +85,8 @@ func alternate(s1 *State, s2 *State) *State { // For example, given the transition 'a', the state 's1' can only be mentioned once. // This would lead to multiple instances of the same set of match indices, since both // 's1' states would be considered to match. - toReturn.transitions[s1.content] = unique_append(toReturn.transitions[s1.content], s1) - toReturn.transitions[s2.content] = unique_append(toReturn.transitions[s2.content], s2) + toReturn.transitions[s1.content], _ = unique_append(toReturn.transitions[s1.content], s1) + toReturn.transitions[s2.content], _ = unique_append(toReturn.transitions[s2.content], s2) toReturn.content = EPSILON toReturn.isEmpty = true