Updated assertion constants so that they aren't exported

This commit is contained in:
2025-01-30 10:18:18 -05:00
parent 7e6377a4c4
commit 289bba35e2
3 changed files with 39 additions and 39 deletions

View File

@@ -107,7 +107,7 @@ func zeroMatchPossible(str []rune, idx int, numGroups int, states ...*State) boo
}
}
for _, state := range tempstates {
if state.isEmpty && (state.assert == NONE || state.checkAssertion(str, idx)) && state.isLast {
if state.isEmpty && (state.assert == noneAssert || state.checkAssertion(str, idx)) && state.isLast {
return true
}
}
@@ -228,7 +228,7 @@ func findAllMatchesHelper(start *State, str []rune, offset int, numGroups int) (
// If the first state is an assertion, makes sure the assertion
// is true before we do _anything_ else.
if start.assert != NONE {
if start.assert != noneAssert {
if start.checkAssertion(str, offset) == false {
i++
return false, []Group{}, i
@@ -329,7 +329,7 @@ func findAllMatchesHelper(start *State, str []rune, offset int, numGroups int) (
// b. Empty
// c. Doesn't assert anything
for _, s := range currentStates {
if s.isLast && s.isEmpty && s.assert == NONE {
if s.isLast && s.isEmpty && s.assert == noneAssert {
lastStatePtr = s
lastStateInList = true
}
@@ -391,7 +391,7 @@ func findAllMatchesHelper(start *State, str []rune, offset int, numGroups int) (
// 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 && i <= len(str) {
if state.assert == NONE || state.checkAssertion(str, i) {
if state.assert == noneAssert || state.checkAssertion(str, i) {
for j := 1; j < numGroups+1; j++ {
tempIndices[j] = state.threadGroups[j]
}