Updated more referencs to constants
This commit is contained in:
@@ -768,7 +768,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
|
||||
// Keep popping from opStack until we encounter an opening parantheses or a NONCAPLPAREN_CHAR. Throw error if we reach the end of the stack.
|
||||
var val rune
|
||||
var err error
|
||||
for val, err = peek(opStack); val != '(' && val != NONCAPLPAREN_CHAR; val, err = peek(opStack) {
|
||||
for val, err = peek(opStack); val != '(' && val != nonCapLparenRune; val, err = peek(opStack) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("imbalanced parantheses")
|
||||
}
|
||||
|
@@ -115,7 +115,7 @@ func range2regex(start int, end int) (string, error) {
|
||||
if startSlc[i] == endSlc[i] {
|
||||
regex += string(rune(startSlc[i] + 48)) // '0' is ascii value 48, 1 is 49 etc. To convert the digit to its character form, we can just add 48.
|
||||
} else {
|
||||
regex += fmt.Sprintf("%c%c-%c%c", lbracketRune, rune(startSlc[i]+48), rune(endSlc[i]+48), RBRACKET)
|
||||
regex += fmt.Sprintf("%c%c-%c%c", lbracketRune, rune(startSlc[i]+48), rune(endSlc[i]+48), rbracketRune)
|
||||
}
|
||||
}
|
||||
regex += ")"
|
||||
|
Reference in New Issue
Block a user