aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_pp.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-09-22 17:50:34 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-09-22 17:50:34 +0200
commitbca562455e1e8cb8be5a5a5de53c926eba51f977 (patch)
tree149a9674f6e42ce9b59f925059b7e98b378e268a /lib/stdlib/src/erl_pp.erl
parent3ef66dd81cd2c21ba201b784f06ac4b5187ea88c (diff)
parent888d5a2004eeb21ac3132e589920f750764ee8c5 (diff)
downloadotp-bca562455e1e8cb8be5a5a5de53c926eba51f977.tar.gz
otp-bca562455e1e8cb8be5a5a5de53c926eba51f977.tar.bz2
otp-bca562455e1e8cb8be5a5a5de53c926eba51f977.zip
Merge branch 'egil/fix-maps-type-pretty-print/OTP-12190' into maint
* egil/fix-maps-type-pretty-print/OTP-12190: edoc, erl_docgen: Enhance internal map type format stdlib: Fix maps type pretty printing
Diffstat (limited to 'lib/stdlib/src/erl_pp.erl')
-rw-r--r--lib/stdlib/src/erl_pp.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/stdlib/src/erl_pp.erl b/lib/stdlib/src/erl_pp.erl
index 82bc2c1460..3dbb5ab64c 100644
--- a/lib/stdlib/src/erl_pp.erl
+++ b/lib/stdlib/src/erl_pp.erl
@@ -300,7 +300,15 @@ map_pair_types(Fs) ->
tuple_type(Fs, fun map_pair_type/1).
map_pair_type({type,_Line,map_field_assoc,Ktype,Vtype}) ->
- {seq,[],[]," =>",[ltype(Ktype),ltype(Vtype)]}.
+ map_assoc_typed(lexpr(Ktype, options(none)), Vtype).
+
+map_assoc_typed(B, {type,_,union,Ts}) ->
+ {first,[B,$\s],{seq,[],[],[],map_assoc_union_type(Ts)}};
+map_assoc_typed(B, Type) ->
+ {list,[{cstep,[B," =>"],ltype(Type)}]}.
+
+map_assoc_union_type([T|Ts]) ->
+ [[leaf("=> "),ltype(T)] | ltypes(Ts, fun union_elem/1)].
record_type(Name, Fields) ->
{first,[record_name(Name)],field_types(Fields)}.