Skip to content

AST confused for records #33

Description

@al2o3cr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions