[JuliaLowering] Use Expr structure in macro expansion #60733
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.
(TODO write more, clean up changes)
Step 4 in the the plan at #60373.
Main changes:
Delete old
expr_to_syntaxtree(hooray)Introduce
est_to_dst, which does a similar conversion as the above, but can assume all macros have expanded. (I've chosen "dst" for to mean "desugarable syntax tree" instead of the "current syntax tree" naming I've been using thus far)Update macro expansion to be a function EST->EST
Add the AST validator from Attempt to define the AST JuliaLowering.jl#93, which I've changed to work on Expr structure. It's included in this PR so that
est_to_dstdoesn't need to do all the same checking (since nothing can be assumed about the output of macro expansion). Most of the long write-up there still applies, and using the same assumptions in desugaring could make it much less messy in the future.forloop, though.We now go though the
Core.@docsystem instead of theK"doc"system, which should be a temporary solution before we (1) get JuliaLowering working, then (2) handle docstrings in lowering in both implementations.Many tests have been updated with the changes in behaviour. I've deleted a few where the point of the test is no longer relevant, but otherwise tried to maintain the spirit of each test.
stdlib status: There shouldn't be any regressions, and TOML now compiles. LibGit2 is now blocked by a different bug.
Atop #60710