Closed Krastanov closed 2 months ago
This was just mentioned on slack. For now the functions too look up are parsestmt
, annotate_scopes
, and formatsrc
Yea, I just posted that over there. Glad you find this work exciting :)
JuliaLowering adds a var_id
to each identifier in the resolve_scopes
pass - a unique ID for each identifier. Currently that ID goes with the var_info
map which is attached to the ScopeResolutionContext
where you can find out more information about the variable.
annotate_scopes
and formatsrc
are currently just hacky tools in test/demo.jl. As for renaming, the extremely new JuliaSyntaxFormatter package could do this if you create a custom format_token_str
function and pass it to format()
.
Do feel free to play around with these things, just be aware that none of this is near "ready for production use" - JuliaLowering doesn't even support most Julia syntax yet!
This is a very exciting package!
What would be the proper way to take code like this (with potentially even more nested scopes)
and use JuliaSyntax/JuliaLowering to transform it into something like
This is a usability question, please feel free to close/redirect if this is the wrong venue to ask.