aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_kernel_pp.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-02-02 10:10:56 +0100
committerBjörn Gustavsson <[email protected]>2011-02-02 10:10:56 +0100
commit8749970bd0163623cddebf46fa6438f75042d40b (patch)
tree2d7d5a2a3836e6b2dcc90259bf87bfd210e1774b /lib/compiler/src/v3_kernel_pp.erl
parent62dad961329a603110ce0e1d3f62554cc5228152 (diff)
downloadotp-8749970bd0163623cddebf46fa6438f75042d40b.tar.gz
otp-8749970bd0163623cddebf46fa6438f75042d40b.tar.bz2
otp-8749970bd0163623cddebf46fa6438f75042d40b.zip
v3_kernel_pp: Eliminate warning
Diffstat (limited to 'lib/compiler/src/v3_kernel_pp.erl')
-rw-r--r--lib/compiler/src/v3_kernel_pp.erl46
1 files changed, 26 insertions, 20 deletions
diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl
index a300dd283f..18cb3edc20 100644
--- a/lib/compiler/src/v3_kernel_pp.erl
+++ b/lib/compiler/src/v3_kernel_pp.erl
@@ -50,28 +50,34 @@ format(Node) -> format(Node, #ctxt{}).
format(Node, Ctxt) ->
case canno(Node) of
-%% [] ->
-%% format_1(Node, Ctxt);
-%% [L,{file,_}] when is_integer(L) ->
-%% format_1(Node, Ctxt);
-%% #k{a=Anno}=K when Anno =/= [] ->
-%% format(setelement(2, Node, K#k{a=[]}), Ctxt);
-%% List ->
-%% format_anno(List, Ctxt, fun (Ctxt1) ->
-%% format_1(Node, Ctxt1)
-%% end);
- _ ->
- format_1(Node, Ctxt)
+ [] ->
+ format_1(Node, Ctxt);
+ [L,{file,_}] when is_integer(L) ->
+ format_1(Node, Ctxt);
+ #k{a=Anno}=K when Anno =/= [] ->
+ format(setelement(2, Node, K#k{a=[]}), Ctxt);
+ List ->
+ format_anno(List, Ctxt, fun (Ctxt1) ->
+ format_1(Node, Ctxt1)
+ end)
end.
-%% format_anno(Anno, Ctxt0, ObjFun) ->
-%% Ctxt1 = ctxt_bump_indent(Ctxt0, 1),
-%% ["( ",
-%% ObjFun(Ctxt0),
-%% nl_indent(Ctxt1),
-%% "-| ",io_lib:write(Anno),
-%% " )"].
-
+format_anno(Anno, Ctxt0, ObjFun) ->
+ case annotations_enabled() of
+ true ->
+ Ctxt1 = ctxt_bump_indent(Ctxt0, 1),
+ ["( ",
+ ObjFun(Ctxt0),
+ nl_indent(Ctxt1),
+ "-| ",io_lib:write(Anno),
+ " )"];
+ false ->
+ ObjFun(Ctxt0)
+ end.
+
+%% By default, don't show annotations since they clutter up the output.
+annotations_enabled() ->
+ false.
%% format_1(Kexpr, Context) -> string().