Skip to content

Commit

Permalink
remove attr_walk_return
Browse files Browse the repository at this point in the history
  • Loading branch information
slepher committed Jan 27, 2021
1 parent 49499fc commit 2fb9ec8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions src/traverse/astranaut_options.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
-export([forms_with_attribute/5]).
-export([options/1]).
-export([validate/2, validate/3]).
-export([attr_walk_return/1]).
-export([by_validator/3]).
-export([get_boolean/4]).

Expand Down Expand Up @@ -98,22 +97,6 @@ validate(Validator, ToValidate, Options) ->
fun(ToValidate1) ->
validate_1(Validator, ToValidate1, Options)
end).

attr_walk_return(#{node := Node} = Map) ->
Map1 = maps:remove(node, Map),
attr_walk_return(Map1#{nodes => [Node]});
attr_walk_return(#{} = Map) ->
Nodes = maps:get(nodes, Map, []),
A = maps:get(return, Map, ok),
Map1 = maps:remove(nodes, Map),
astranaut_walk_return:new(Map1#{return => {Nodes, A}});
attr_walk_return(Return) ->
case astranaut_walk_return:to_map(Return) of
{ok, Map} ->
attr_walk_return(Map);
error ->
attr_walk_return(#{return => Return})
end.
%%--------------------------------------------------------------------
%% @doc
%% @spec
Expand Down
2 changes: 1 addition & 1 deletion test/astranaut_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ test_forms_with_attribute(_Config) ->
astranaut_options:forms_with_attribute(
fun(Attr, Acc, #{line := Line}) ->
Node = astranaut:attribute_node(mark_1, Line, Attr),
astranaut_options:attr_walk_return(#{node => Node, return => [Attr|Acc]})
{[Node], [Attr|Acc]}
end, [], Forms, mark, #{simplify_return => true}),
Marks1 =
astranaut_options:with_attribute(
Expand Down

0 comments on commit 2fb9ec8

Please sign in to comment.