     {ast, %{acc | aliases: aliases, lines_to_context: lines_to_context}}
   end
 
-  defp post(ast = {:defmodule, _, [{:__aliases__, _, module}, _]}, acc) do
+  defp post({:defmodule, _, [{:__aliases__, _, module}, _]} = ast, acc) do
     outer_mods   = Enum.drop(acc.modules, length(module))
     outer_scopes = Enum.drop(acc.scopes, length(module))
     {ast, %{acc | modules: outer_mods, scopes: outer_scopes, imports: tl(acc.imports), aliases: tl(acc.aliases)}}

    traverse(ast, acc, &pre/2, &post/2)
  end

  defp pre(ast = {:defmodule, [line: line], [{:__aliases__, _, module}, _]}, acc) do
    modules_reversed = :lists.reverse(module)
    modules = modules_reversed ++ acc.modules
    scopes  = modules_reversed ++ acc.scopes

    pre({:import, meta, [module_info, []]}, acc)
  end

  defp pre({:import, [line: line], [{_, _, module_atoms = [mod|_]}, _opts]} = ast, acc) when is_atom(mod) do
    current_module  = acc.modules |> :lists.reverse |> Module.concat
    current_imports = acc.imports |> :lists.reverse |> List.flatten
    current_aliases = acc.aliases |> :lists.reverse |> List.flatten
