[experiment] implementation for quote ast proposal #10446
Closed
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.
My implementation for nim-lang/RFCs#122
Work in progress. There are lots of examples in the implementation (most of the code) that is supposed to show how the mentioned examples would work in the new quoteAst proposal.
There are issues that need to be discussed though.
fixed issues
This is the list of issues that will be fixed when this PR is finished:
#10326
#7375
#9745
#7889
#8220
#7589
#7726
#10430
Preserving line information is verbose
This only affects the generated code. To preserve the line information from the quoted AST in the generated newTree expression, a new function to set the line information has been added to the macros module. This is the difference in the generated code for the same quoted AST.
And here the line information is only set for two nodes, It isn't even enabled for literals and identifier. For more complex macros this could increase the memory consumption and required performance dramatically for something that is only needed for debugging (stack traces).