Packages

An Elixir framework to build your own in-house PaaS (Platform as a Service).

Current section

Files

Jump to
antikythera lib util macro_util.ex
Raw

lib/util/macro_util.ex

# Copyright(c) 2015-2021 ACCESS CO., LTD. All rights reserved.
use Croma
defmodule Antikythera.MacroUtil do
@moduledoc """
Utilities to manipulate Elixir AST.
"""
defun prewalk_accumulate(q :: Macro.t(), acc :: any, f :: (Macro.t(), any -> any)) :: any do
Macro.prewalk(q, acc, fn t, acc -> {t, f.(t, acc)} end)
|> elem(1)
end
end