For example this:
ast = quote do
if 2 == 2 do
:foo
end
end
Macro.expand(ast, __ENV__)
Resolves to:
{:case, [optimize_boolean: true],
[{:==, [context: Elixir, import: Kernel], [2, 2]},
[do: [{:->, [],
[[{:when, [],
[{:x, [counter: -576460752303422810], Kernel},
{:in, [context: Kernel, import: Kernel],
[{:x, [counter: -576460752303422810], Kernel}, [false, nil]]}]}],
nil]}, {:->, [], [[{:_, [], Kernel}], :foo]}]]]}
I’m curious as to what counter
refers to in:
{:x, [counter: -576460752303422810], Kernel}
My first thoughts were that it has something to do with staying hygienic and keeping track of scope, but then I found the line
metadata which seems to be responsible for that.
Is there somewhere where the different AST metadata is documented?