Skip to content

[5.9] Add a function to merge trivia from a node into an existing trivia #1502

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 2 commits into from
Apr 8, 2023

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Apr 7, 2023

  • Explanation: Adds new methods for merging trivia from a node, dropping the matching prefix from the RHS. Also cleans up Trivia so only the parts that have to be generated are.
  • Scope: New functionality, no clients are impacted
  • Risk: Low, this introduces new Trivia.merging methods
  • Original PR: Add a function to merge trivia from a node into an existing trivia #1478

bnbarham added 2 commits April 7, 2023 13:17
The actual `Trivia` definition doesn't need to be generated at all, only
the static funcs and vars. Move it into SwiftSyntax proper.

(cherry picked from commit cb0f24e)
Generally when a node is removed, we need to add its trivia to an
existing node. Add a small helper function to aid in this case.

(cherry picked from commit ca6d6b5)
@bnbarham bnbarham requested a review from ahoppen as a code owner April 7, 2023 20:33
@bnbarham
Copy link
Contributor Author

bnbarham commented Apr 7, 2023

@swift-ci please test

@bnbarham bnbarham requested a review from DougGregor April 7, 2023 23:58
@bnbarham bnbarham merged commit 2a9988f into swiftlang:release/5.9 Apr 8, 2023
@bnbarham bnbarham deleted the cherry-merge-trivia branch April 8, 2023 00:06
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