Permalink
Browse files

Simplify add_exports/1 transformation.

  • Loading branch information...
1 parent 70bf371 commit 2da2027c6ab38bb971eab2192124e94a3bbf0470 @pichi pichi committed Nov 27, 2013
Showing with 5 additions and 12 deletions.
  1. +5 −12 src/proper_transformer.erl
View
@@ -133,19 +133,12 @@ is_prop(_) ->
false.
-spec add_exports([abs_form()], [{fun_name(),arity()}]) -> [abs_form()].
-add_exports(Forms, ToExport) ->
- add_exports_tr(Forms, [], ToExport).
-
--spec add_exports_tr([abs_form()], [abs_form()], [{fun_name(),arity()}]) ->
- [abs_form()].
-add_exports_tr([], Acc, _ToExport) ->
- lists:reverse(Acc);
-add_exports_tr([{attribute,_,module,_} = ModAttr | Rest], Acc, ToExport) ->
+add_exports([], _ToExport) -> [];
+add_exports([{attribute,_,module,_} = ModAttr | Rest], ToExport) ->
ExpAttr = {attribute,0,export,ToExport},
- lists:reverse(Acc, [ModAttr, ExpAttr | Rest]);
-add_exports_tr([Form | Rest], Acc, ToExport) ->
- add_exports_tr(Rest, [Form | Acc], ToExport).
-
+ [ModAttr, ExpAttr | Rest];
+add_exports([Form | Rest], ToExport) ->
+ [Form | add_exports(Rest, ToExport)].
%%------------------------------------------------------------------------------
%% Helper server interface

0 comments on commit 2da2027

Please sign in to comment.