thrift_generator_emitter_syntax (thrift_generator v0.7.0)
View SourceThe erl_syntax helper layer the emitters build forms with: module
headers, attributes, function forms, -doc attributes, literal terms
and the rendering to source text.
Everything here is pure and descriptor-free — no #tg_* records and no
resolution context — so the core emitter and the service emitter share
one vocabulary for building and printing abstract forms. Callback and
spec attributes carry raw erl_parse type nodes (erl_prettypr cannot
lay them), so those are rendered as raw forms (erl_pp), while
everything else stays trees.
Summary
Functions
-spec abstract(term()) -> erl_syntax:syntaxTree().
-spec application(module(), atom(), [erl_syntax:syntaxTree()]) -> erl_syntax:syntaxTree().
-spec attribute(atom(), term() | erl_syntax:syntaxTree()) -> erl_syntax:syntaxTree().
-spec banner_comment(binary()) -> erl_syntax:syntaxTree().
-spec base_erlang_type(atom()) -> erl_syntax:syntaxTree().
-spec doc_form(binary() | undefined, binary()) -> erl_syntax:forms().
-spec error_term_type(erl_anno:anno()) -> erl_syntax:syntaxTree().
-spec export_form([{atom(), arity()}]) -> erl_syntax:syntaxTree().
-spec export_type_form([{atom(), arity()}]) -> {attribute, erl_anno:anno(), export_type, [{atom(), arity()}]}.
-spec exports_forms([{atom(), arity()}]) -> erl_syntax:forms().
-spec fn_clause([erl_syntax:syntaxTree()], erl_syntax:syntaxTree()) -> erl_syntax:syntaxTree().
-spec fn_form(atom(), [erl_syntax:syntaxTree()]) -> erl_syntax:forms().
-spec format(erl_syntax:forms()) -> binary().
-spec fun_type([erl_syntax:syntaxTree()], erl_syntax:syntaxTree()) -> erl_syntax:syntaxTree().
-spec header(module(), binary()) -> erl_syntax:forms().
-spec map_field(atom(), erl_syntax:syntaxTree()) -> erl_syntax:syntaxTree().
-spec moduledoc_form(binary()) -> erl_syntax:forms().
-spec nowarn_unused_record_form() -> erl_syntax:syntaxTree().
-spec ok_error_type(erl_anno:anno(), erl_syntax:syntaxTree(), erl_syntax:syntaxTree()) -> erl_syntax:syntaxTree().
-spec raw_type(atom()) -> erl_syntax:syntaxTree().
-spec remote_type(module(), atom()) -> erl_syntax:syntaxTree().
-spec section_form(string()) -> erl_syntax:syntaxTree().
-spec term_type() -> erl_syntax:syntaxTree().
-spec undefined_union(erl_syntax:syntaxTree()) -> erl_syntax:syntaxTree().
-spec user_type(atom()) -> erl_syntax:syntaxTree().
-spec var_fun() -> fun((string()) -> erl_syntax:syntaxTree()).
-spec wildcard() -> erl_syntax:syntaxTree().