Removed character range creation from the first part of shuntingYard() (the part that adds concatenation operators), because octal and hex values haven't yet been deciphered at this point in the code

master
Aadhavan Srinivasan 2 weeks ago
parent ae09462bd4
commit 649485f01d

@ -155,21 +155,6 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
i++ // Skip all characters inside _unescaped_ brackets (we are _not_ at a closing bracket, or if we are, the previous character is a backslash) i++ // Skip all characters inside _unescaped_ brackets (we are _not_ at a closing bracket, or if we are, the previous character is a backslash)
// TODO: Check for escaped characters // TODO: Check for escaped characters
// Check ahead for character range
if i < len(re_runes)-2 && re_runes[i+1] == '-' {
rangeStart := re_runes[i]
rangeEnd := re_runes[i+2]
if int(rangeEnd) < int(rangeStart) {
return nil, fmt.Errorf("Range is out of order.")
}
for i := rangeStart; i <= rangeEnd; i++ {
toAppend = append(toAppend, i)
}
i += 2 // Skip start and hyphen (end will automatically be skipped on next iteration of loop)
continue
}
toAppend = append(toAppend, re_runes[i]) toAppend = append(toAppend, re_runes[i])
} }
// Replace the last character (which should have been ']', with RBRACKET // Replace the last character (which should have been ']', with RBRACKET

Loading…
Cancel
Save