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

@@ -871,30 +871,30 @@ func thompson(re []postfixNode) (Reg, error) {
if c.lookaroundDir == 0 || c.lookaroundSign == 0 {
switch c.contents[0] {
case '^':
state.assert = SOS
state.assert = sosAssert
case '$':
state.assert = EOS
state.assert = eosAssert
case 'b':
state.assert = WBOUND
state.assert = wboundAssert
case 'B':
state.assert = NONWBOUND
state.assert = nonwboundAssert
}
} else { // Lookaround
state.lookaroundRegex = string(c.contents)
if c.lookaroundDir == lookahead {
if c.lookaroundSign == positive {
state.assert = PLA
state.assert = plaAssert
}
if c.lookaroundSign == negative {
state.assert = NLA
state.assert = nlaAssert
}
}
if c.lookaroundDir == lookbehind {
if c.lookaroundSign == positive {
state.assert = PLB
state.assert = plbAssert
}
if c.lookaroundSign == negative {
state.assert = NLB
state.assert = nlbAssert
}
}
tmpRe, err := shuntingYard(state.lookaroundRegex)
@@ -919,7 +919,7 @@ func thompson(re []postfixNode) (Reg, error) {
}
if c.nodetype == lparenNode || c.nodetype == rparenNode {
s := &State{}
s.assert = NONE
s.assert = noneAssert
s.content = newContents(EPSILON)
s.isEmpty = true
s.output = make([]*State, 0)