Skip to content
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

Prevent invalid character ranges #65

Merged
merged 3 commits into from
Jul 24, 2024
Merged

Conversation

gukoff
Copy link
Contributor

@gukoff gukoff commented Jun 19, 2024

  • Prevent invalid character ranges
  • More informative error message for unsolvable regexes
  • Removed tail recursion
  • Fixed var name typo.

--

Throwing exception from Xeger ctor is a somewhat controversial choice.

The original library seems to not do so, and we accept the other invalid constructions such as \w{7,1}.
At the same time, in the function MakeInterval there's already a precedent of throwing.

Alternatively, I thought of of adding examples of unsolvable regexes to the README, and in the error message link to this section of README. The only examples I can think of are [\w-.] and \w{7,1}.

--

Should solve #44

Also remove tail recursion, fix var name typo.
@gukoff gukoff changed the title More informative error message. Prevent invalid character ranges Jun 19, 2024
@gukoff
Copy link
Contributor Author

gukoff commented Jul 24, 2024

@moodmosaic ping!

Copy link
Owner

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this! Please accept my apologies for the delay. I completely missed this.

@moodmosaic moodmosaic merged commit c9143df into moodmosaic:master Jul 24, 2024
@moodmosaic
Copy link
Owner

@gukoff, thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants