apex
apex copied to clipboard
AST confused for records
Passing Elixir AST (for instance, the output of quote
) triggers the "Elixir record" behavior here.
Example:
iex(3)> ast = quote do
...(3)> foo[1].bar
...(3)> end
{{:., [], [{{:., [], [Access, :get]}, [], [{:foo, [], Elixir}, 1]}, :bar]}, [],
[]}
iex(4)> Apex.ap(ast)
{
[0] .{
[0] []
[1] [
[0] {
[0] .{
[0] []
[1] [
[0] :Elixir.Access
[1] :get
]
}
[1] []
[2] [
[0] foo{
[0] []
[1] :Elixir
}
[1] 1
]
}
[1] :bar
]
}
[1] []
[2] []
}
Would a "no srsly I don't have records here" option make sense? Something like the numbers: false
setting.