aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_kernel_pp.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-08-23 08:48:34 +0200
committerBjörn Gustavsson <[email protected]>2016-09-21 14:07:53 +0200
commit1d43ca9f9a236b29cb9f22917bbcfa84d1e0fa6f (patch)
tree71c9a5547c1896233004c4a4b1debeaf0af89416 /lib/compiler/src/v3_kernel_pp.erl
parent01835845579e9f0a8da3574864747cd3ba10db6e (diff)
downloadotp-1d43ca9f9a236b29cb9f22917bbcfa84d1e0fa6f.tar.gz
otp-1d43ca9f9a236b29cb9f22917bbcfa84d1e0fa6f.tar.bz2
otp-1d43ca9f9a236b29cb9f22917bbcfa84d1e0fa6f.zip
v3_life: Eliminate special handling of guards
Remove the special handling #k_try{} in guards in v3_life. If we introduce a new #k_protected{} record in v3_kernel, v3_life no longer needs to know whether it is processing guards or bodies.
Diffstat (limited to 'lib/compiler/src/v3_kernel_pp.erl')
-rw-r--r--lib/compiler/src/v3_kernel_pp.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl
index 0b90f0a1e0..45065b7e11 100644
--- a/lib/compiler/src/v3_kernel_pp.erl
+++ b/lib/compiler/src/v3_kernel_pp.erl
@@ -279,6 +279,15 @@ format_1(#k_try_enter{arg=A,vars=Vs,body=B,evars=Evs,handler=H}, Ctxt) ->
nl_indent(Ctxt),
"end"
];
+format_1(#k_protected{arg=A,ret=Rs}, Ctxt) ->
+ Ctxt1 = ctxt_bump_indent(Ctxt, Ctxt#ctxt.body_indent),
+ ["protected",
+ nl_indent(Ctxt1),
+ format(A, Ctxt1),
+ nl_indent(Ctxt),
+ "end",
+ format_ret(Rs, ctxt_bump_indent(Ctxt, 1))
+ ];
format_1(#k_catch{body=B,ret=Rs}, Ctxt) ->
Ctxt1 = ctxt_bump_indent(Ctxt, Ctxt#ctxt.body_indent),
["catch",