Skip to content

Simplify capture representations #360

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
Apr 28, 2022
Merged

Conversation

milseman
Copy link
Member

@milseman milseman commented Apr 27, 2022

Make CaptureStructure semi-vestigial and introduce an array-of-structs CaptureList to use instead. Flipping from singly to multiply-nested captures is just flipping a Bool, though we still need to feed that info into the existentially stored captures.

@milseman milseman marked this pull request as ready for review April 27, 2022 13:17
@milseman milseman changed the title Prepare for non-nested captures Simplify capture representations Apr 27, 2022
@milseman milseman requested review from rxwei and natecook1000 April 27, 2022 13:19
@milseman milseman requested a review from hamishknight April 27, 2022 14:48
@milseman
Copy link
Member Author

@hamishknight I see

@available(*, deprecated, message: "moving to SwiftCompilerModules")
func libswiftParseRegexLiteral(

What is the compiler-library interaction story? Is this function called or does the logic have to live outside the library?

@hamishknight
Copy link
Contributor

I believe those libswift... functions can be removed now that they've been moved into the compiler repo (cc @rintaro)

@milseman
Copy link
Member Author

But what does that mean WRT the interface? We really wanted to keep this logic in the library because it's super easy to break otherwise. Case in point, I think this PR would break it because it makes CaptureStructure internal

@milseman
Copy link
Member Author

At the very least we need a comment convention for what is a compiler-locked API and what isn't. We could do that via _spi actually, which would be nice.

@hamishknight
Copy link
Contributor

Yeah I think it makes sense to add back complier entry points, which should be the only thing the compiler calls into (and yeah we could make them SPI). We can keep the bridging gunk on the compiler side tho.

@milseman
Copy link
Member Author

Do you think you can commit those changes to this PR? I'm not the most up to date.

@milseman
Copy link
Member Author

@swift-ci please test

@milseman milseman merged commit 838bdfe into swiftlang:main Apr 28, 2022
@milseman milseman deleted the capture_canon branch April 28, 2022 18:10
natecook1000 pushed a commit to natecook1000/swift-experimental-string-processing that referenced this pull request May 12, 2022
Introduce CaptureList, make CaptureStructure semi-vestigial
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