Improve readability of test harness

This commit is contained in:
Felipe Sere
2016-03-11 12:59:46 +00:00
parent e48cc261a9
commit 3d5da67c8d
2 changed files with 19 additions and 6 deletions

View File

@@ -15,11 +15,9 @@ defmodule ASTMangler do
|> Enum.find_index(fn(x) -> x == :__ end)
|> replace(args, b)
end
def replace(nil, ast, b) when is_list(ast) do
Enum.map(ast, fn(element) -> expand(element, b) end)
end
def replace(index, list, b) when is_integer(index) do
List.update_at(list, index, fn(_)-> b end)
end