Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #6 from nox/let-errors-through

Let error markers through parse_transform:do/5
  • Loading branch information...
commit 216531d99f2e3807d4afcd9ff1ab55bc4ba9e685 2 parents 0ec1da7 + 11f137a
@uwiger authored
Showing with 13 additions and 17 deletions.
  1. +13 −17 src/parse_trans.erl
View
30 src/parse_trans.erl
@@ -309,23 +309,19 @@ depth_first(Fun, Acc, Forms, Options) when is_function(Fun, 4) ->
do(fun do_depth_first/4, Fun, Acc, Forms, Options).
do(Transform, Fun, Acc, Forms, Options) ->
- case [E || {error,_} = E <- Forms] of
- [_|_] -> {error, []};
- [] ->
- Context = initial_context(Forms, Options),
- File = Context#context.file,
- try Transform(Fun, Acc, Forms, Context) of
- {NewForms, _} = Result when is_list(NewForms) ->
- optionally_pretty_print(NewForms, Options, Context),
- Result
- catch
- error:Reason ->
- {error,
- [{File, [{?DUMMY_LINE, ?MODULE,
- {Reason, erlang:get_stacktrace()}}]}]};
- throw:{error, Ln, What} ->
- {error, [{error, {Ln, ?MODULE, What}}]}
- end
+ Context = initial_context(Forms, Options),
+ File = Context#context.file,
+ try Transform(Fun, Acc, Forms, Context) of
+ {NewForms, _} = Result when is_list(NewForms) ->
+ optionally_pretty_print(NewForms, Options, Context),
+ Result
+ catch
+ error:Reason ->
+ {error,
+ [{File, [{?DUMMY_LINE, ?MODULE,
+ {Reason, erlang:get_stacktrace()}}]}]};
+ throw:{error, Ln, What} ->
+ {error, [{error, {Ln, ?MODULE, What}}]}
end.
-spec top(function(), forms(), list()) ->
Please sign in to comment.
Something went wrong with that request. Please try again.