-
Notifications
You must be signed in to change notification settings - Fork 50
RegexBuilder module #227
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
RegexBuilder module #227
Conversation
@swift-ci please test |
b78683f
to
f6c5cbb
Compare
I didn't move |
@swift-ci please test |
1 similar comment
@swift-ci please test |
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.
LGTM! I think we may want to talk a bit further about where things like extension String: RegexComponent {}
should live, but this should be good for now. It's not ideal that myString.firstMatch(of: "[0-9]+")
will work out of the box, and resolve to the regex method, even though it's evaluating as a string literal search.
I'll extricate CharacterClass
in a follow-up with some API revisions.
Sources/RegexBuilder/DSL.swift
Outdated
@@ -10,6 +10,16 @@ | |||
//===----------------------------------------------------------------------===// | |||
|
|||
import _MatchingEngine | |||
@_spi(RegexBuilder) import _StringProcessing | |||
import _StringProcessing |
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.
Do we need this given we already have line 13?
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.
Good catch. Removed.
Move the regex builder DSL (except `RegexComponent`) to a new module named RegexBuilder. The DSL depends on `DSLTree` and a few other supporting types, so those types have been made `_spi(RegexBuilder) public`. The SPI establishes an ABI between `_StringProcessing` and `RegexBuilder`, but I don't think it's a concern because the two modules will co-evolve and both will be rebuilt for every release.
f6c5cbb
to
b2b35df
Compare
@swift-ci please test |
The [regex builder DSL](https://forums.swift.org/t/pitch-regex-builder-dsl/56007) proposal adds regex builder to a new module named `RegexBuilder`. Friend PR: swiftlang/swift-experimental-string-processing#227
Move the regex builder DSL (except
RegexComponent
) to a new module named RegexBuilder. The DSL depends onDSLTree
and a few other supporting types, so those types have been made_spi(RegexBuilder) public
. The SPI establishes an ABI between_StringProcessing
andRegexBuilder
, but I don't think it's a concern because the two modules will co-evolve and both will be rebuilt for every release.