Skip to content

Move RegexComponent conformances to RegexBuilder #279

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

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

natecook1000
Copy link
Member

This moves the RegexComponent conformances for String, Substring, etc to the RegexBuilder module. This will remove extra API from strings, such as the option-setting methods, when not writing DSL regexes, and also cut down on confusing usage of regex-oriented APIs with strings or characters.

This moves the RegexComponent conformances for String, Substring, etc
to the RegexBuilder module. This will remove extra API from strings,
such as the option-setting methods, when not writing DSL regexes, and
also cut down on confusing usage of regex-oriented APIs with strings
or characters.
@natecook1000 natecook1000 requested review from rxwei and milseman April 14, 2022 17:31
@natecook1000
Copy link
Member Author

@swift-ci Please test

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

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

LGTM

Big improvement, though I do wonder if the associated type on RegexComponent should be named something like RegexOutput, since this type aliases on common types could clearly collide with something else. E.g. some kind of successor to TextOutputStream or some other parsing solution.

Otherwise we're waiting for the feature that allows us to use a different name to satisfy the requirement. I really want that feature anyways, so it might not be a big deal.

Regex's generic parameter can still remain Output. @rxwei, WDYT?

@rxwei
Copy link
Contributor

rxwei commented Apr 14, 2022

Regex's generic parameter can still remain Output. @rxwei, WDYT?

Good suggestion. I agree.

@natecook1000
Copy link
Member Author

Good call, Michael - going to merge this and follow up with that name change.

@natecook1000 natecook1000 merged commit 4428e7f into swiftlang:main Apr 14, 2022
Azoy pushed a commit to Azoy/swift-experimental-string-processing that referenced this pull request Apr 19, 2022
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.

3 participants