Skip to content

Internalize _CharacterClassModel #578

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 3 commits into from
Jul 14, 2022

Conversation

hamishknight
Copy link
Contributor

Rip out unused _CharacterClassModel API and make it an internal type by removing the last use of makeDSLTreeCharacterClass.

Remove the DSL -> _CharacterClassModel conversion,
and _CharacterClassModel's custom character class
matching logic, none of which is being used.
`makeDSLTreeCharacterClass` was the last API
that required it to be public. Remove it, and
replace it with some static members on `_AST.Atom`.
@hamishknight
Copy link
Contributor 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, thanks

@@ -740,6 +740,32 @@ extension DSLTree {
@_spi(RegexBuilder)
public struct Atom {
internal var ast: AST.Atom

// FIXME: The below APIs should be removed once the DSL tree has been
// migrated to use proper DSL atoms for them.
Copy link
Member

Choose a reason for hiding this comment

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

What does this entail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding them as dedicated cases to DSLTree.Atom (or splitting out a new BuiltinCharacterClass type perhaps), and then getting the consumer logic working with them. It's probably not too effort, but I'm going to leave it as a follow up for now. I can file an issue to track it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #579

@hamishknight hamishknight merged commit 99e5e51 into swiftlang:main Jul 14, 2022
@hamishknight hamishknight deleted the internalize-character-model branch July 14, 2022 17:29
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