aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_specs.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-10-24 21:17:11 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-01-28 17:06:41 +0100
commitb42453915e4c6aa1133e88c06a60dfbc5fe5e1f0 (patch)
tree7b551c7584bc56b706a47a1d610e9cb3e176e9f3 /lib/edoc/src/edoc_specs.erl
parent351987be44e11e6eb9e5841adb197ec8e49bc49d (diff)
downloadotp-b42453915e4c6aa1133e88c06a60dfbc5fe5e1f0.tar.gz
otp-b42453915e4c6aa1133e88c06a60dfbc5fe5e1f0.tar.bz2
otp-b42453915e4c6aa1133e88c06a60dfbc5fe5e1f0.zip
edoc,syntax_tools: Teach Map understanding
Diffstat (limited to 'lib/edoc/src/edoc_specs.erl')
-rw-r--r--lib/edoc/src/edoc_specs.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/edoc/src/edoc_specs.erl b/lib/edoc/src/edoc_specs.erl
index 5acf8ac0d5..466c9df951 100644
--- a/lib/edoc/src/edoc_specs.erl
+++ b/lib/edoc/src/edoc_specs.erl
@@ -358,6 +358,14 @@ d2e({type,_,tuple,any}) ->
d2e({type,_,binary,[Base,Unit]}) ->
#t_binary{base_size = element(3, Base),
unit_size = element(3, Unit)};
+d2e({type,_,map,any}) ->
+ #t_map{ types = []};
+d2e({type,_,map,Es}) ->
+ #t_map{ types = d2e(Es) };
+d2e({type,_,map_field_assoc,K,V}) ->
+ #t_map_field{ k_type = d2e(K), v_type=d2e(V) };
+d2e({type,_,map_field_exact,K,V}) ->
+ #t_map_field{ k_type = d2e(K), v_type=d2e(V) };
d2e({type,_,tuple,Ts0}) ->
Ts = d2e(Ts0),
typevar_anno(#t_tuple{types = Ts}, Ts);
@@ -476,6 +484,11 @@ xrecs(#t_fun{args = Args0, range = Range0}=T, P) ->
Args = xrecs(Args0, P),
Range = xrecs(Range0, P),
T#t_fun{args = Args, range = Range};
+xrecs(#t_map{ types = Ts0 }=T,P) ->
+ Ts = xrecs(Ts0, P),
+ T#t_map{ types = Ts };
+xrecs(#t_map_field{ k_type=Kt, v_type=Vt}=T, P) ->
+ T#t_map_field{ k_type=xrecs(Kt,P), v_type=xrecs(Vt,P)};
xrecs(#t_tuple{types = Types0}=T, P) ->
Types = xrecs(Types0, P),
T#t_tuple{types = Types};