Rebar3 Pretty Printing of abstract Erlang syntax trees, based on original erl_prettypr.
It was taken verbatim from erl_prettypr and it was modified to meet our specific needs.
This module is a front end to the pretty-printing library moduleprettypr
, for text formatting of abstract syntax trees defined by
the module erl_syntax
.
syntaxTree() = erl_syntax:syntaxTree()
An abstract syntax tree. See the erl_syntax
module for
details.
format/2 | Prettyprint-formats an abstract Erlang syntax tree as text. |
format(Tree::syntaxTree(), Options::[term()]) -> string()
Prettyprint-formats an abstract Erlang syntax tree as text. For
example, if you have a .beam
file that has been compiled with
debug_info
, the following should print the source code for the
module (as it looks in the debug info representation):
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks("myfile.beam",[abstract_code]), io:put_chars(rebar3_prettypr:format(erl_syntax:form_list(AC)))Available options:
See also: erl_syntax, format/1, layout/2.
Generated by EDoc