From c9fdf5aa6c22fc74fe641b01b142018946306598 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sun, 27 Oct 2024 11:18:42 -0400 Subject: [PATCH] Restored old behavior with end-of-string - new one didn't seem to work well --- matching.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/matching.go b/matching.go index 8f2f855..09700cd 100644 --- a/matching.go +++ b/matching.go @@ -29,11 +29,8 @@ func findAllMatches(start *State, str string) (indices []matchIndex) { return findAllMatchesHelper(start, str, make([]matchIndex, 0), 0) } func findAllMatchesHelper(start *State, str string, indices []matchIndex, offset int) []matchIndex { - // 'Base case' - exit if string is empty. If the starting state is a last-state, then append the final set of indices (trailing whitespace) + // 'Base case' - exit if string is empty. if len(str) == 0 { - if start.isLast { - indices = append(indices, matchIndex{offset, offset + 1}) - } return indices }