-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suboptimal output for some common cases #24
Comments
Yeah, regexpu doesn’t have an optimizer pass. For common regular expressions, where things like |
Note that |
I'm trying to optimize the
Let's consider one by one the different top-level alternatives separated by
By putting those minimized forms together, we get:
Is it correct? |
@nicolo-ribaudo The old and new versions behave differently for inputs like |
I know that currently regexpu-core operates on low-level range set representation, but thought I'd write down my thoughts on some output optimisations.
It looks like output could be better optimised for no-op transforms and other common cases. Some examples from README:
Given the absense of flags and corresponding transforms, this could be better preserved as just
.
.Doesn't save as much as previous example, but could output
[^]
instead. This would also allow easily transforming justs
while preserving theu
flag if one wants that.I think this could be optimised further as well, but, while trying to come up with a shorter version, found what looks like a bug in current output - #23 - so I guess it's better to fix that one first.
The text was updated successfully, but these errors were encountered: