Where is the documentation for the AST metadata entries?

Hello,

the function Macro.update_meta/2 is documented as useful to manipulate AST metadata:

Applies the given function to the node metadata if it contains one.

This is often useful when used with Macro.prewalk/2 to remove information like lines and hygienic counters from the expression for either storage or comparison.

This means that AST metadata can be accessed for reads and writes, but I cannot find a document explaining the format and semantics of all possible AST metadata entries.

Do you know the link for the document explaining AST metadata?

Thanks

4 Likes

I am really surprised that no one knows or cares about AST metadata, except myself and two more people :face_with_raised_eyebrow:

1 Like

Elixir has no spec sadly, so there really isn’t a lot of it that is documented as would be expected, but I have learned that the metadata tends to be anything from empty to containing the line and file and some other things, and you can put whatever you want to on it as well and Elixir will ignore it.

There are other things like context, import and alias at least. I have just created this issue regarding this missing topic.

1 Like