Skip to content
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

Expand AST using Macro.Env API #293

Merged
merged 239 commits into from
Oct 5, 2024
Merged

Expand AST using Macro.Env API #293

merged 239 commits into from
Oct 5, 2024

Conversation

lukaszsamson
Copy link
Collaborator

This PR replaces MetadataBuilder implementation with a mini compiler that is close to what elixir compiler does when traversing AST. It expands special forms and macros (if possible).
Key differences from elixir compiler:

  • It is designed to be error tolerant. In most places where elixir will throw off the compilation it attempt to continue
  • It does not do any tracing
  • It doesn't evaluate code. It means that it is not able to handle dynamic code and quoted defs
  • it is not able to expand local macros. This would require evaluating and compiling the code
  • it intercepts a few Kernel, Record macros (defmodule, def, defguard, defdelegate, @, defrecord, defprotocol, defimpl), attempts to traverse the code and extract info

@lukaszsamson lukaszsamson changed the title [WIP] Expand AST using Macro.Env API Expand AST using Macro.Env API Oct 5, 2024
@lukaszsamson lukaszsamson merged commit d1ebaad into master Oct 5, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants