Skip to content

Add a detach() to syntax nodes #1103

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
Dec 5, 2022
Merged

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Dec 2, 2022

Allow clients to detach (ie. re-root) a syntax tree.

Also remove RawSyntaxToSyntax since this should only be used by this parser, which can just use the Syntax constructor directly instead.

@bnbarham bnbarham requested a review from ahoppen as a code owner December 2, 2022 21:13
@bnbarham
Copy link
Contributor Author

bnbarham commented Dec 3, 2022

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Looks good to me but I don’t see any use cases for detach. What are you planning to use it for?

@bnbarham
Copy link
Contributor Author

bnbarham commented Dec 3, 2022

Looks good to me but I don’t see any use cases for detach. What are you planning to use it for?

Cases where you want to pass around a subtree without access to the rest of the tree.

Allow clients to detach (ie. re-root) a syntax tree.

Also remove `RawSyntaxToSyntax` since this should only be used by this
parser, which can just use the `Syntax` constructor directly instead.
@bnbarham
Copy link
Contributor Author

bnbarham commented Dec 3, 2022

@swift-ci please test

@bnbarham bnbarham merged commit 0b170fa into swiftlang:main Dec 5, 2022
@bnbarham bnbarham deleted the add-detach branch December 5, 2022 19:31
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