Module hank_utils

Utility functions.

Description

Utility functions

Function Index

ast_has_attrs/2Whether the given AST nodes list has defined the given AttrNames attribute names or not.
attr_args/2Same as attr_args/3 but with a dummy default MapFunc.
attr_args/3Extract attribute arguments from given AST nodes list whose attribute name is AttrName and apply MapFunc to every element.
attr_args_concrete/2Same as attr_args/3 but calling erl_syntax:concrete/1 for each element.
attr_name/1Macro dodging version of erl_syntax:attribute_name/1.
format_text/2Format rule result text for console output.
function_description/1Get the function definition name and arity of a given Function Node.
implements_behaviour/1Whether the given AST nodes list has behaviours implemented or not.
macro_arity/1Get the macro arity of given Node.
macro_definition_name/1Get the macro definition name and arity of a given Macro Node.
macro_name/1Get the parsed macro name of given Node.
node_has_attrs/2Whether the given Node node has defined the given AttrNames attribute names or not.
parse_macro_name/1Parse the given Node macro name.
paths_match/2Whether one of the given paths is contained inside the other one or not.

Function Details

ast_has_attrs/2

ast_has_attrs(AST::erl_syntax:forms(), AttrName::atom() | [atom()]) -> boolean()

Whether the given AST nodes list has defined the given AttrNames attribute names or not

attr_args/2

attr_args(AST::erl_syntax:forms(), AttrName::atom() | [atom()]) -> [term()]

Same as attr_args/3 but with a dummy default MapFunc

attr_args/3

attr_args(AST::erl_syntax:forms(), AttrName::atom() | [atom()], MapFunc::function()) -> [term()]

Extract attribute arguments from given AST nodes list whose attribute name is AttrName and apply MapFunc to every element

attr_args_concrete/2

attr_args_concrete(AST::erl_syntax:forms(), AttrName::atom() | [atom()]) -> [term()]

Same as attr_args/3 but calling erl_syntax:concrete/1 for each element

attr_name/1

attr_name(Node::erl_syntax:syntaxTree()) -> atom()

Macro dodging version of erl_syntax:attribute_name/1

format_text/2

format_text(Text::string(), Args::list()) -> binary()

Format rule result text for console output

function_description/1

function_description(Node::erl_syntax:syntaxTree()) -> string()

Get the function definition name and arity of a given Function Node.

implements_behaviour/1

implements_behaviour(AST::erl_syntax:forms()) -> boolean()

Whether the given AST nodes list has behaviours implemented or not

macro_arity/1

macro_arity(Node::erl_syntax:syntaxTree()) -> none | pos_integer()

Get the macro arity of given Node

macro_definition_name/1

macro_definition_name(Node::erl_syntax:syntaxTree()) -> {string(), integer() | atom()}

Get the macro definition name and arity of a given Macro Node.

macro_name/1

macro_name(Node::erl_syntax:syntaxTree()) -> string()

Get the parsed macro name of given Node

node_has_attrs/2

node_has_attrs(Node::erl_syntax:syntaxTree(), AttrName::atom() | [atom()]) -> boolean()

Whether the given Node node has defined the given AttrNames attribute names or not

parse_macro_name/1

parse_macro_name(Node::erl_syntax:syntaxTree()) -> string()

Parse the given Node macro name

paths_match/2

paths_match(IncludePath::string(), X2::string()) -> boolean()

Whether one of the given paths is contained inside the other one or not. It doesn't matter which one is contained at which other. Verifies if FilePath and IncludePath refer both to the same file. Note that we can't just compare both filename:absname's here, since we don't really know what is the absolute path of the file referred by the include directive.


Generated by EDoc