Skip to content

Allow putting garbage nodes in between any two children of a Syntax node #514

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 4 commits into from
Aug 4, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 24, 2022

Companion of swiftlang/swift#60211

@CodaFi
Copy link
Contributor

CodaFi commented Aug 1, 2022

I presume we'll come around and clean up the places we're allowing you to stick garbage explicitly in the tree then?

  • CodeBlockItemSyntax
  • AttributeSyntax

@ahoppen
Copy link
Member Author

ahoppen commented Aug 2, 2022

Yes, I wanted to do that in a follow-up PR to keep this one focused.

@ahoppen ahoppen force-pushed the pr/garbage-syntax branch from 890ec4b to 121a430 Compare August 2, 2022 10:08
@ahoppen ahoppen force-pushed the pr/garbage-syntax branch from 121a430 to befe26f Compare August 3, 2022 06:02
@ahoppen ahoppen force-pushed the pr/garbage-syntax branch from befe26f to 857aede Compare August 4, 2022 07:21
If the `garbage` parameters in the SyntaxFactory are labelled, it’s not possible to specify e.g. the second garbage node but leave the others to their default (swiftlang/swift#60274).

We could either give these `garbage` parameters distinct names or make them unlabeled to work around that issue. I chose to go for the unlabeled approach because it should be clear that these parameters contain garbage because of their type.
@ahoppen ahoppen force-pushed the pr/garbage-syntax branch from 857aede to 1258671 Compare August 4, 2022 07:22
@ahoppen
Copy link
Member Author

ahoppen commented Aug 4, 2022

swiftlang/swift#60211

@swift-ci Please test

@ahoppen ahoppen merged commit 2ff1171 into swiftlang:main Aug 4, 2022
@ahoppen ahoppen deleted the pr/garbage-syntax branch August 4, 2022 11:11
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