-
Notifications
You must be signed in to change notification settings - Fork 326
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
Wip/gmt/match find only text #5721
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good generally a few little changes.
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
Co-authored-by: James Dunkerley <[email protected]>
…so into wip/gmt/match-find-only-text
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
Use method calls not static. Add return at end of file.
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Case_Sensitivity.enso
Show resolved
Hide resolved
case_insensitive = case_sensitivity.is_case_insensitive | ||
case Regex.compile pattern case_insensitive=case_insensitive . match self Regex_Mode.All of | ||
Nothing -> [] | ||
matches -> matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do the check this way, we lose the locale
information from the Case_Sensitivity
setting. I understand we cannot easily override the locale setting for Regex - OK. We have the same issue in DB - and I think we should do the same check there too - check if the setting had the default ROOT
locale - if so - we can proceed. If the user has overridden the locale to something else, they may count on some custom behaviour that we cannot provide here - so I think in that case we should raise an Illegal_Argument
error saying that custom-locale-backed case insensitivity is not supported here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are replacing the Regex.compile
method in the next ticket and it moves to taking a Case_Sensitive
parameter with exactly that logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I did not know this was temporary. Sounds good then!
I think ideally we could add a test case for this too (with this next ticket).
Closes #5121 |
Pull Request Description
Rename is_match + match to match + find (respectively), and remove all non-regexp functionality.
Regexp flags and Match_Mode are also no longer supported by these methods.