diff options
author | Micael Karlberg <[email protected]> | 2011-02-28 11:44:35 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-02-28 11:44:35 +0100 |
commit | 26eae94979083f6ae272b76589bce256b792e487 (patch) | |
tree | 1ac07672c29efd352f2009908c1b441a31b74c24 /lib/compiler/src/v3_kernel_pp.erl | |
parent | 9671856faa243ee4567f4059fba28fd85b5d9baa (diff) | |
parent | e170c7f2ce8e0ac2cd45c922afc138305ca34b79 (diff) | |
download | otp-26eae94979083f6ae272b76589bce256b792e487.tar.gz otp-26eae94979083f6ae272b76589bce256b792e487.tar.bz2 otp-26eae94979083f6ae272b76589bce256b792e487.zip |
Merge branch 'dev' into bmk/megaco/miscellaneous_dialyzer/OTP-9075
Had to fix a bunch of CopyRight end-dates (in erts files)...
Diffstat (limited to 'lib/compiler/src/v3_kernel_pp.erl')
-rw-r--r-- | lib/compiler/src/v3_kernel_pp.erl | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl index 9bd13f7032..e363a5387a 100644 --- a/lib/compiler/src/v3_kernel_pp.erl +++ b/lib/compiler/src/v3_kernel_pp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,10 +20,12 @@ -module(v3_kernel_pp). --include("v3_kernel.hrl"). - -export([format/1]). +%%-define(INCLUDE_ANNOTATIONS, 1). + +-include("v3_kernel.hrl"). + %% These are "internal" structures in sys_kernel which are here for %% debugging purposes. -record(iset, {anno=[],vars,arg,body}). @@ -62,22 +64,21 @@ format(Node, Ctxt) -> end) end. -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. +-ifndef(INCLUDE_ANNOTATIONS). +%% Don't include annotations (for readability). +format_anno(_Anno, Ctxt, ObjFun) -> + ObjFun(Ctxt). +-else. +%% Include annotations (for debugging of annotations). +format_anno(Anno, Ctxt0, ObjFun) -> + Ctxt1 = ctxt_bump_indent(Ctxt0, 1), + ["( ", + ObjFun(Ctxt0), + nl_indent(Ctxt1), + "-| ",io_lib:write(Anno), + " )"]. +-endif. %% format_1(Kexpr, Context) -> string(). |