ktn_code (katana_code v2.4.0)
View SourceSummary
Types
Should eventually become beam_lib:beam(), once that's exposed (https://github.com/erlang/otp/pull/7534)
Should eventually become erl_syntax:annotation_or_location(), once that's exposed (https://github.com/erlang/otp/pull/7535)
Functions
If the beam was not compiled with debug_info
the code generated by this function will look really ugly
If the beam was not compiled with debug_info
the code generated by this function will look really ugly
Like file:consult/1
but for strings and binaries.
Evaluates the Erlang expression in the string provided.
Parses code in a string or binary format and returns the parse tree.
Types
-type beam_lib_beam() :: file:filename() | binary().
Should eventually become beam_lib:beam(), once that's exposed (https://github.com/erlang/otp/pull/7534)
-type erl_parse_foo() :: {attribute, Pos :: erl_syntax_annotation_or_location(), Name :: erl_syntax:syntaxTree(), Args :: none | [erl_syntax:syntaxTree()]} | {macro, Pos :: erl_syntax_annotation_or_location(), Name :: erl_syntax:syntaxTree(), Args :: none | [erl_syntax:syntaxTree()]} | {atom, [{node, Node :: erl_syntax:syntaxTree()}], non_reversible_form}.
-type erl_syntax_annotation_or_location() :: erl_anno:anno() | erl_anno:location().
Should eventually become erl_syntax:annotation_or_location(), once that's exposed (https://github.com/erlang/otp/pull/7535)
-type tree_node() :: #{type => tree_node_type(), attrs => map(), node_attrs => map(), content => [tree_node()]}.
-type tree_node_type() :: atom().
Functions
-spec beam_to_erl(beam_lib_beam(), string()) -> ok.
If the beam was not compiled with debug_info
the code generated by this function will look really ugly
-spec beam_to_string(beam_lib_beam()) -> {ok, string()} | {error, beam_lib, term()}.
If the beam was not compiled with debug_info
the code generated by this function will look really ugly
Like file:consult/1
but for strings and binaries.
Evaluates the Erlang expression in the string provided.
Parses code in a string or binary format and returns the parse tree.
-spec type(tree_node()) -> undefined | tree_node_type().