Renamed one more variable to avoid exporting
This commit is contained in:
@@ -233,7 +233,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
|
|||||||
i++
|
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
|
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])
|
toAppend = append(toAppend, re_runes[i])
|
||||||
i++
|
i++
|
||||||
@@ -524,7 +524,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
|
|||||||
if firstCharAdded && re_postfix[i] == rbracketRune {
|
if firstCharAdded && re_postfix[i] == rbracketRune {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if re_postfix[i] == CHAR_RANGE {
|
if re_postfix[i] == charRangeRune {
|
||||||
endOfRange = true
|
endOfRange = true
|
||||||
i++
|
i++
|
||||||
continue
|
continue
|
||||||
|
@@ -15,7 +15,7 @@ var lparenRune rune = 0xF0005 // Parentheses in regex are concatenated with thi
|
|||||||
var rparenRune rune = 0xF0006
|
var rparenRune rune = 0xF0006
|
||||||
var nonCapLparenRune rune = 0xF0007 // Represents a non-capturing group's LPAREN
|
var nonCapLparenRune rune = 0xF0007 // Represents a non-capturing group's LPAREN
|
||||||
var escBackslashRune rune = 0xF0008 // Represents an escaped backslash
|
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}
|
var specialChars = []rune{'?', '*', '\\', '^', '$', '{', '}', '(', ')', '[', ']', '+', '|', '.', concatRune, '<', '>', lbracketRune, rbracketRune, nonCapLparenRune}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user