internal: Add SyntaxFactory to ease generating nodes with syntax mappings#18196
Merged
bors merged 2 commits intorust-lang:masterfrom Sep 27, 2024
Merged
internal: Add SyntaxFactory to ease generating nodes with syntax mappings#18196bors merged 2 commits intorust-lang:masterfrom
SyntaxFactory to ease generating nodes with syntax mappings#18196bors merged 2 commits intorust-lang:masterfrom
Conversation
Veykril
approved these changes
Sep 27, 2024
Member
|
@bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
Member
|
Not really the place to discuss but I wonder how this could play into having quasi quoting #2227. I guess that could take a factory as an extra input or return something that needs to go through the factory to be "registered" |
Contributor
Author
|
@Veykril Having an extra input to the quasi quoting macro(s) would probably be best, as doing something like post-registering with the factory would mean that we'd always need to generate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #15710
Instead of requiring passing a
&mut SyntaxEditorto every make constructor to generate mappings, we instead wrap that logic inSyntaxFactory, and afterwards add all the mappings to theSyntaxEditor.Includes an example of using
SyntaxEditor&SyntaxFactoryin theextract_variableassist.