Return a new error instead of rethrowing a non-existent error

master
Aadhavan Srinivasan 3 days ago
parent 4f577592ba
commit c3059fe899

@ -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, err return nil, fmt.Errorf("invalid POSIX character class")
} }
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

Loading…
Cancel
Save