Fixed typo
This commit is contained in:
@@ -150,7 +150,7 @@ func findAllMatchesHelper(start *State, str string, indices []matchIndex, offset
|
|||||||
tempIndices, _ = unique_append(tempIndices, matchIndex{startIdx, endIdx})
|
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 {
|
if i == startingFrom {
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
@@ -208,12 +208,15 @@ func findAllMatchesHelper(start *State, str string, indices []matchIndex, offset
|
|||||||
tempStates = nil
|
tempStates = nil
|
||||||
|
|
||||||
for _, state := range currentStates {
|
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) {
|
if state.isLast && startIdx < len(str) {
|
||||||
|
if state.assert == NONE || state.checkAssertion([]rune(str), len(str)) {
|
||||||
endIdx = i
|
endIdx = i
|
||||||
tempIndices, _ = unique_append(tempIndices, matchIndex{startIdx, endIdx})
|
tempIndices, _ = unique_append(tempIndices, matchIndex{startIdx, endIdx})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Get the maximum index-range from the list
|
// Get the maximum index-range from the list
|
||||||
if len(tempIndices) > 0 {
|
if len(tempIndices) > 0 {
|
||||||
indexToAdd := Reduce(tempIndices, func(i1 matchIndex, i2 matchIndex) matchIndex {
|
indexToAdd := Reduce(tempIndices, func(i1 matchIndex, i2 matchIndex) matchIndex {
|
||||||
|
Reference in New Issue
Block a user