|
|
|
@ -150,7 +150,7 @@ func findAllMatchesHelper(start *State, str string, indices []matchIndex, offset
|
|
|
|
|
tempIndices, _ = unique_append(tempIndices, matchIndex{startIdx, endIdx})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if assertionFailed && numStatesMatched == 0 { // Nothing has matched and an assertion has failed - bort
|
|
|
|
|
if assertionFailed && numStatesMatched == 0 { // Nothing has matched and an assertion has failed - abort
|
|
|
|
|
if i == startingFrom {
|
|
|
|
|
i++
|
|
|
|
|
}
|
|
|
|
@ -208,10 +208,13 @@ func findAllMatchesHelper(start *State, str string, indices []matchIndex, offset
|
|
|
|
|
tempStates = nil
|
|
|
|
|
|
|
|
|
|
for _, state := range currentStates {
|
|
|
|
|
// Only add the match if the start index is in bounds
|
|
|
|
|
// Only add the match if the start index is in bounds. If the state has an assertion,
|
|
|
|
|
// make sure the assertion checks out.
|
|
|
|
|
if state.isLast && startIdx < len(str) {
|
|
|
|
|
endIdx = i
|
|
|
|
|
tempIndices, _ = unique_append(tempIndices, matchIndex{startIdx, endIdx})
|
|
|
|
|
if state.assert == NONE || state.checkAssertion([]rune(str), len(str)) {
|
|
|
|
|
endIdx = i
|
|
|
|
|
tempIndices, _ = unique_append(tempIndices, matchIndex{startIdx, endIdx})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Get the maximum index-range from the list
|
|
|
|
|