Module ktn_code

Data Types

tree_node()

tree_node() = #{type => tree_node_type(), attrs => map(), node_attrs => map(), content => [tree_node()]}

tree_node_type()

tree_node_type() = root | function | clause | match | tuple | atom | integer | float | string | char | binary | binary_element | var | call | remote | 'case' | case_expr | case_clauses | 'fun' | named_fun | query | 'try' | try_catch | try_case | try_after | 'if' | 'catch' | 'receive' | receive_after | receive_case | nil | cons | map | map_field_assoc | map_field_exact | lc | lc_expr | generate | bc | bc_expr | b_generate | op | record | record_field | record_index | block | module | type | callback | export | export_type | remote_type | type | ann_type | paren_type | any

Function Index

attr/2
beam_to_erl/2If the beam was not compiled with debug_info the code generated by this function will look really ugly.
beam_to_string/1If the beam was not compiled with debug_info the code generated by this function will look really ugly.
consult/1Like file:consult/1 but for strings and binaries.
content/1
eval/1Evaluates the erlang expression in the string provided.
node_attr/2
parse_tree/1Parses code in a string or binary format and returns the parse tree.
to_str/1
type/1

Function Details

attr/2

attr(Key::term(), Node::tree_node()) -> term() | undefined

beam_to_erl/2

beam_to_erl(BeamPath::beam_lib:beam(), ErlPath::string()) -> ok

If the beam was not compiled with debug_info the code generated by this function will look really ugly

beam_to_string/1

beam_to_string(BeamPath::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

consult/1

consult(Source::string() | binary()) -> [term()]

Like file:consult/1 but for strings and binaries.

content/1

content(Node::tree_node()) -> [tree_node()]

eval/1

eval(Source::string() | binary()) -> term()

Evaluates the erlang expression in the string provided.

node_attr/2

node_attr(Key::term(), Node::tree_node()) -> term() | undefined

parse_tree/1

parse_tree(Source::string() | binary()) -> tree_node()

Parses code in a string or binary format and returns the parse tree.

to_str/1

to_str(Arg::binary() | list() | atom() | integer()) -> string()

type/1

type(X1::tree_node()) -> atom()


Generated by EDoc