-
Notifications
You must be signed in to change notification settings - Fork 462
Expose whether a regex_automata error was a size overflow or another error #1236
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
Comments
Yeah, I think adding a simple predicate like, The other two classes of errors are "NFA failed to build" and "regex feature unsupported." The latter, I believe, can never happen if Unicode mode is disabled. The former is only relevant if you're using the convenience APIs that build a DFA from a pattern string (which you are here). But even that can be avoided by using So if you use @konstin Do you have ideas for what the predicate should be named? |
|
This adds a new predicate that supports very minimal introspection ability into why DFA construction failed. Closes #1236
This adds a new predicate that supports very minimal introspection ability into why DFA construction failed. Closes #1236
I'm building an DFA from user provided expressions for a fast-path optimization, which I can skip when the DFA would be too large. Currently, there is no way to tell whether building the DFA failed because there was a syntax error (which I want to raise to the user), or because there was a size overflow (which is non-fatal). It would be great if
regex_automata::dfa::dense::BuildError
would allow inspecting whether it's a size error.Motivating example:
The text was updated successfully, but these errors were encountered: