Module etran_util

Authors: Serge Aleynikov (saleyn(at)gmail(dot)com).

Description

Erlang parse transform utility functions

Function Index

apply_transform/4Apply parse transform with debug printing options.
debug_options/2Get parse transforms debug options.
parse_options/2Check if KnownFlags are found in Options.
source_forms/2Decompile source code from the AST.
transform/2Transform Forms by applying a lambda Fun.
transform/3Transform Forms by applying a lambda Fun.

Function Details

apply_transform/4

apply_transform(Module, Fun, AST, Options) -> any()

Apply parse transform with debug printing options

debug_options/2

debug_options(Module :: atom(), Options :: list()) ->
                 #{orig => boolean(),
                   ast => boolean(),
                   src => boolean()}

Get parse transforms debug options

parse_options/2

parse_options(KnownFlags :: list(), Options :: list()) ->
                 [boolean()]

Check if KnownFlags are found in Options.

source_forms/2

source_forms(AST :: list(), Options :: list()) -> ok | string()

Decompile source code from the AST

transform/2

transform(Fun :: fun((Forms :: term()) -> tuple() | continue),
          Forms :: term()) ->
             list()

Transform Forms by applying a lambda Fun.

transform/3

transform(Fun ::
              fun((Forms :: term(), State :: term()) ->
                      {tuple() | continue, NewState :: term()}),
          Forms :: term(),
          State :: term()) ->
             {list(), NewState :: term()}

Transform Forms by applying a lambda Fun.