-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use post-lowering code? #76
Comments
Learning materials:
More specific code examples:
|
Thanks Tim, this is really helpful! I will give it a try. |
Is there a way to get lowered top-level code in a module? I'm having trouble finding a way to do that, which would be nice since then we might be able to drop parsing altogether. (Though already using lowered code for methods would be a win). |
You mean stuff that runs at module-definition time but doesn't result in a method signature? Great question, and AFAIK the answer is no. For that you do have to parse 😢. You could probably call |
If ExplicitImports were to iterate over all the names in the package, and then for every item that is a method, ask for
Base.uncompressed_ast
, then you could tally all theGlobalRef
s that appear in the lowered code. This would presumably make your scope resolution fully accurate.JuliaInterpreter does lots of shenanigans with lowered code, including replacing all
GlobalRefs
with the actual object (to save the cost of scope-resolution at runtime). So its code might be a good reference if you need pointers.The text was updated successfully, but these errors were encountered: