find_options() = #{mode => node | zipper, traverse => content | all}
| code_zipper/1 | |
| code_zipper/2 | |
| exported_functions/1 | Takes the root node of a parse_tree and returns name and arity of each exported function. |
| find/2 | Same as calling find/3 with #{mode => node, traverse => content} as
the options map. |
| find/3 | Find all nodes in the tree for which the predicate function returns
true. |
| find_by_location/2 | |
| find_token/2 | |
| function_names/1 | Takes the root node of a parse_tree and returns the name of each function, whether exported or not. |
| module_name/1 | Takes the root node and returns the module's name. |
| past_nesting_limit/2 | Takes a node and returns all nodes where the nesting limit is exceeded. |
| print_node/1 | Debugging utility function. |
| print_node/2 |
code_zipper(Root::ktn_code:tree_node()) -> zipper:zipper()
code_zipper(Root::ktn_code:tree_node(), Mode::content | all) -> zipper:zipper()
exported_functions(X1::ktn_code:tree_node()) -> [{atom(), integer()}]
Takes the root node of a parse_tree and returns name and arity of each exported function.
find(Pred::fun((zipper:zipper()) -> boolean()), Root::ktn_code:tree_node()) -> [ktn_code:tree_node()]
Same as calling find/3 with #{mode => node, traverse => content} as
the options map.
find(Pred::fun((zipper:zipper()) -> boolean()), Root::ktn_code:tree_node(), Opts::find_options()) -> [ktn_code:tree_node()]
Find all nodes in the tree for which the predicate function returns
true. The options map has two keys:
mode: when the value node is specified the predicate function
receives a tree_node() as its argument. When zipper is specified
the argument is the zipper location for the current node.
traverse: the value content indicates to only take into account
nodes in the parent-child hierarchy. When all is provided the
nodes held in the node_attrs map are also taken into account in
the search.
find_by_location(Root::ktn_code:tree_node(), Location::{integer(), integer()}) -> not_found | {ok, ktn_code:tree_node()}
find_token(Root::ktn_code:tree_node(), Location::{integer(), integer()}) -> not_found | {ok, map()}
function_names(X1::ktn_code:tree_node()) -> [atom()]
Takes the root node of a parse_tree and returns the name of each function, whether exported or not.
module_name(X1::ktn_code:tree_node()) -> atom()
Takes the root node and returns the module's name.
past_nesting_limit(Node::ktn_code:tree_node(), MaxLevel::integer()) -> [{ktn_code:tree_node(), integer()}]
Takes a node and returns all nodes where the nesting limit is exceeded.
print_node(Node::ktn_code:tree_node()) -> ok
Debugging utility function.
print_node(Node::ktn_code:tree_node(), CurrentLevel::integer()) -> ok
Generated by EDoc