From 16d48acbde6cd272c02ce7db2fd4dc8ad973f7d2 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 28 May 2010 10:03:46 +0200 Subject: Improved indentation of old catch. An example that didn't work previously. case Foo of {ok, X} -> ok; _ -> catch file:close(FD) end. --- lib/tools/emacs/test.erl.indented | 51 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) (limited to 'lib/tools/emacs/test.erl.indented') diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented index b94968a2b0..2948ccf1b5 100644 --- a/lib/tools/emacs/test.erl.indented +++ b/lib/tools/emacs/test.erl.indented @@ -512,7 +512,9 @@ indent_try_catch() -> file:close(Xfile) end; indent_try_catch() -> - try foo(bar) of + try + foo(bar) + of X when true andalso kalle -> io:format(stdout, "Parsing file ~s, ", @@ -570,14 +572,57 @@ indent_catch() -> C = catch B + float(43.1), - case catch (X) of + case catch foo(X) of + A -> + B + end, + + case + catch foo(X) + of A -> B end, + + case + foo(X) + of + A -> + catch B, + X + end, + try sune of _ -> foo catch _:_ -> baf - end. + end, + + try + sune + of + _ -> + X = 5, + (catch foo(X)), + X + 10 + catch _:_ -> baf + end, + + try + (catch sune) + of + _ -> + catch foo() %% BUGBUG can't handle catch inside try without parentheses + catch _:_ -> + baf + end, + + try + (catch exit()) + catch + _ -> + catch baf() + end, + ok. indent_binary() -> X = lists:foldr(fun(M) -> -- cgit v1.2.3