ktn_code (katana_code v2.3.1)
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() :: 'case' | 'catch' | 'else' | 'fun' | 'if' | 'maybe' | 'receive' | 'try' | any | atom | b_generate | bc | bc_expr | binary | binary_element | block | call | callback | case_clauses | case_expr | char | clause | comment | cons | default | define | else_attr | export | float | function | generate | if_attr | import | integer | lc | lc_expr | m_generate | macro | map | map_field_assoc | map_field_exact | match | maybe_match | mc | mc_expr | module | named_fun | nil | nominal | op | opaque | query | receive_after | receive_case | record | record_attr | record_field | record_index | remote | remote_type | root | spec | string | try_after | try_case | try_catch | tuple | type | type_attr | type_map_field | typed_record_field | user_type | var | 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().