Closed terrorfisch closed 1 year ago
Somehow I overlooked literal_matcher_from_pattern that depends on regex so dropping the dependency is of the table for now.
I benchmarked using regexes some time ago. I could never identify compiled regexes as some kind of performance bottleneck.
After testing I came to the same conclusion. The only reason for this for me would be to allow custom non-latin/greek names i.e. all valid python identifiers although this is by far not a pressing issue.
The regex crate is currently used for checking if a string starts with a valid identifier or is a valid identifier. From what I know this is a bit overkill and it's faster to write simple matches explicitly. I suggest doing something like this:
with
unicode-ident = { version = "1", optional = true }
and a featureunicode = ["unicode-ident"]
.If you think this is a good idea I can make a pull request.