Renamed one more variable to avoid exporting

This commit is contained in:
2025-01-30 10:45:09 -05:00
parent 7e792f1248
commit 2e3450285c
2 changed files with 3 additions and 3 deletions

View File

@@ -233,7 +233,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
i++
}
if re_runes[i] == '-' && (i > 0 && re_runes[i-1] != '\\') && (i < len(re_runes)-1 && re_runes[i+1] != rbracketRune) { // Unescaped hyphen, that has some character (not a RBRACKET) after it - This represents a character range, so we replace with CHAR_RANGE. This metacharacter will be used later on to construct the range
re_runes[i] = CHAR_RANGE
re_runes[i] = charRangeRune
}
toAppend = append(toAppend, re_runes[i])
i++
@@ -524,7 +524,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
if firstCharAdded && re_postfix[i] == rbracketRune {
break
}
if re_postfix[i] == CHAR_RANGE {
if re_postfix[i] == charRangeRune {
endOfRange = true
i++
continue

View File

@@ -15,7 +15,7 @@ var lparenRune rune = 0xF0005 // Parentheses in regex are concatenated with thi
var rparenRune rune = 0xF0006
var nonCapLparenRune rune = 0xF0007 // Represents a non-capturing group's LPAREN
var escBackslashRune rune = 0xF0008 // Represents an escaped backslash
var CHAR_RANGE rune = 0xF0009 // Represents a character range
var charRangeRune rune = 0xF0009 // Represents a character range
var specialChars = []rune{'?', '*', '\\', '^', '$', '{', '}', '(', ')', '[', ']', '+', '|', '.', concatRune, '<', '>', lbracketRune, rbracketRune, nonCapLparenRune}