diff options
author | Björn-Egil Dahlberg <[email protected]> | 2014-01-27 11:52:00 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-01-29 11:08:49 +0100 |
commit | f6370a6d73406e11d4a7664e566502c005062b0d (patch) | |
tree | 4b5a2135d163b66cb90769e68a8a4f9b5ced1687 /lib/hipe/cerl/cerl_prettypr.erl | |
parent | bc34b5dafaebf07d7185900310246f5752c0a6c4 (diff) | |
download | otp-f6370a6d73406e11d4a7664e566502c005062b0d.tar.gz otp-f6370a6d73406e11d4a7664e566502c005062b0d.tar.bz2 otp-f6370a6d73406e11d4a7664e566502c005062b0d.zip |
hipe: Fixup update cerl pretty printer
Diffstat (limited to 'lib/hipe/cerl/cerl_prettypr.erl')
-rw-r--r-- | lib/hipe/cerl/cerl_prettypr.erl | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/hipe/cerl/cerl_prettypr.erl b/lib/hipe/cerl/cerl_prettypr.erl index ee5b41207b..22f5b8945a 100644 --- a/lib/hipe/cerl/cerl_prettypr.erl +++ b/lib/hipe/cerl/cerl_prettypr.erl @@ -63,8 +63,7 @@ seq_arg/1, seq_body/1, string_lit/1, try_arg/1, try_body/1, try_vars/1, try_evars/1, try_handler/1, tuple_es/1, type/1, values_es/1, var_name/1, - - map_es/1, map_pair_es/1 + map_es/1, map_pair_key/1, map_pair_val/1, map_pair_op/1 ]). -define(PAPER, 76). @@ -429,10 +428,8 @@ lay_1(Node, Ctxt) -> lay_tuple(Node, Ctxt); map -> lay_map(Node, Ctxt); - map_pair_assoc -> - lay_map_pair_assoc(Node, Ctxt); - map_pair_exact -> - lay_map_pair_exact(Node, Ctxt); + map_pair -> + lay_map_pair(Node, Ctxt); 'let' -> lay_let(Node, Ctxt); seq -> @@ -604,15 +601,14 @@ lay_map(Node, Ctxt) -> Ctxt, fun lay/2)), floating(text("}~")))). -lay_map_pair_assoc(Node, Ctxt) -> - [K,V] = map_pair_es(Node), - beside(floating(text("::<")), - beside(lay(K,Ctxt),beside(floating(text(",")), beside(lay(V,Ctxt), - floating(text(">")))))). - -lay_map_pair_exact(Node, Ctxt) -> - [K,V] = map_pair_es(Node), - beside(floating(text("~<")), +lay_map_pair(Node, Ctxt) -> + K = map_pair_key(Node), + V = map_pair_val(Node), + OpTxt = case concrete(map_pair_op(Node)) of + assoc -> "::<"; + exact -> "~<" + end, + beside(floating(text(OpTxt)), beside(lay(K,Ctxt),beside(floating(text(",")), beside(lay(V,Ctxt), floating(text(">")))))). |