Extract internal Regex API for PCRE backend#12802
Merged
straight-shoota merged 6 commits intocrystal-lang:masterfrom Dec 14, 2022
Merged
Extract internal Regex API for PCRE backend#12802straight-shoota merged 6 commits intocrystal-lang:masterfrom
straight-shoota merged 6 commits intocrystal-lang:masterfrom
Conversation
This was referenced Nov 29, 2022
Closed
42836ff to
dd12f5c
Compare
Member
Author
|
So there was actually a bug in the original refactor that didn't get caught by the spec suite, despite its huge expansion. I added some missing test cases in #12804 (also first commit in this branch). |
c087ce6 to
ca016bd
Compare
4d50cf9 to
a3383de
Compare
a3383de to
2827c9c
Compare
caspiano
reviewed
Dec 5, 2022
beta-ziliani
approved these changes
Dec 12, 2022
Member
beta-ziliani
left a comment
There was a problem hiding this comment.
Nothing worth blocking 👍
src/regex/pcre.cr
Outdated
| # :nodoc: | ||
| module Regex::PCRE | ||
| # :nodoc: | ||
| def initialize(*, _source source, _options @options) |
Member
There was a problem hiding this comment.
Why not make this one private too? Also, wouldn't it make sense to change its name, and avoid the renaming of arguments?
Member
Author
There was a problem hiding this comment.
Yeah, I think private should work. I think the nodoc is an artifact from an earlier setup where private wouldn't have worked.
Changing the name would make this not be a constructor which causes problems with ivar initialization.
carlhoerberg
pushed a commit
to carlhoerberg/crystal
that referenced
this pull request
Dec 21, 2022
This was referenced Mar 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch extracts code that relates directly to implementation details of the libpcre backend from
RegexandRegex::MatchDataand puts it into a moduleRegex::PCRE.This abstraction is then to be used for an alternative engine using PCRE2 (#12790).
The first two commits are an separate change submitted in #12810.Commit
three and fourone and two are general refactors which are useful on their own and make the extraction easier.