diff options
author | Björn Gustavsson <[email protected]> | 2012-05-16 10:50:30 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-01-28 15:56:25 +0100 |
commit | 64ee859fc4c17259ab95192abf7493fed8f2b0ac (patch) | |
tree | 8506892a03635fa44f523f4daf470c4845e63e77 /lib/compiler/src/v3_kernel_pp.erl | |
parent | d3ece60d52880fb273da3c4aa07655a0eeddeafb (diff) | |
download | otp-64ee859fc4c17259ab95192abf7493fed8f2b0ac.tar.gz otp-64ee859fc4c17259ab95192abf7493fed8f2b0ac.tar.bz2 otp-64ee859fc4c17259ab95192abf7493fed8f2b0ac.zip |
Implement support for maps in the compiler
To make it possible to build the entire OTP system, also define
dummys for the instructions in ops.tab.
Diffstat (limited to 'lib/compiler/src/v3_kernel_pp.erl')
-rw-r--r-- | lib/compiler/src/v3_kernel_pp.erl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl index e363a5387a..1af90792d3 100644 --- a/lib/compiler/src/v3_kernel_pp.erl +++ b/lib/compiler/src/v3_kernel_pp.erl @@ -104,6 +104,19 @@ format_1(#k_tuple{es=Es}, Ctxt) -> format_hseq(Es, ",", ctxt_bump_indent(Ctxt, 1), fun format/2), $} ]; +format_1(#k_map{var=#k_var{}=Var,es=Es}, Ctxt) -> + [$~,${, + format_hseq(Es, ",", ctxt_bump_indent(Ctxt, 1), fun format/2), + " | ",format_1(Var, Ctxt), + $},$~ + ]; +format_1(#k_map{es=Es}, Ctxt) -> + [$~,${, + format_hseq(Es, ",", ctxt_bump_indent(Ctxt, 1), fun format/2), + $},$~ + ]; +format_1(#k_map_pair{key=K,val=V}, Ctxt) -> + ["~<",format(K, Ctxt),",",format(V, Ctxt),">"]; format_1(#k_binary{segs=S}, Ctxt) -> ["#<",format(S, ctxt_bump_indent(Ctxt, 2)),">#"]; format_1(#k_bin_seg{next=Next}=S, Ctxt) -> |