|
|
@ -407,7 +407,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
escapedNode, err := newEscapedNode(re_postfix[i], false)
|
|
|
|
escapedNode, err := newEscapedNode(re_postfix[i], false)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("invalid escape character in expression")
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
outQueue = append(outQueue, escapedNode)
|
|
|
|
outQueue = append(outQueue, escapedNode)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -575,7 +575,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
escapedNode, err := newEscapedNode(re_postfix[i], true)
|
|
|
|
escapedNode, err := newEscapedNode(re_postfix[i], true)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("invalid escape character in character class")
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
chars = append(chars, escapedNode)
|
|
|
|
chars = append(chars, escapedNode)
|
|
|
|
i++
|
|
|
|
i++
|
|
|
@ -627,7 +627,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
|
|
|
|
case "word": // Word characters
|
|
|
|
case "word": // Word characters
|
|
|
|
nodeToAdd, _ = newEscapedNode('w', true) // This isn't going to error, so I suppress it
|
|
|
|
nodeToAdd, _ = newEscapedNode('w', true) // This isn't going to error, so I suppress it
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return nil, fmt.Errorf("invalid POSIX character class")
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
chars = append(chars, nodeToAdd)
|
|
|
|
chars = append(chars, nodeToAdd)
|
|
|
|
i = temp_i + len(posixClass) + 2 // Skip over the class name, the closing colon and the closing bracket
|
|
|
|
i = temp_i + len(posixClass) + 2 // Skip over the class name, the closing colon and the closing bracket
|
|
|
|