diff options
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(">")))))). |