aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_docgen
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-09-11 19:21:01 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-09-12 15:22:14 +0200
commit888d5a2004eeb21ac3132e589920f750764ee8c5 (patch)
tree60b46e476902b9e219792a474307cfddd3ef5156 /lib/erl_docgen
parentec09f59a9e055d947c9bc0790e726c5e80724068 (diff)
downloadotp-888d5a2004eeb21ac3132e589920f750764ee8c5.tar.gz
otp-888d5a2004eeb21ac3132e589920f750764ee8c5.tar.bz2
otp-888d5a2004eeb21ac3132e589920f750764ee8c5.zip
edoc, erl_docgen: Enhance internal map type format
Diffstat (limited to 'lib/erl_docgen')
-rw-r--r--lib/erl_docgen/src/docgen_otp_specs.erl17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/erl_docgen/src/docgen_otp_specs.erl b/lib/erl_docgen/src/docgen_otp_specs.erl
index cbdbbbee80..1075c47801 100644
--- a/lib/erl_docgen/src/docgen_otp_specs.erl
+++ b/lib/erl_docgen/src/docgen_otp_specs.erl
@@ -390,8 +390,6 @@ t_type([#xmlElement{name = tuple, content = Es}]) ->
t_tuple(Es);
t_type([#xmlElement{name = map, content = Es}]) ->
t_map(Es);
-t_type([#xmlElement{name = map_field, content = Es}]) ->
- t_map_field(Es);
t_type([#xmlElement{name = 'fun', content = Es}]) ->
["fun("] ++ t_fun(Es) ++ [")"];
t_type([E = #xmlElement{name = record, content = Es}]) ->
@@ -435,9 +433,10 @@ t_tuple(Es) ->
["{"] ++ seq(fun t_utype_elem/1, Es, ["}"]).
t_map(Es) ->
- ["#{"] ++ seq(fun t_utype_elem/1, Es, ["}"]).
+ Fs = get_elem(map_field, Es),
+ ["#{"] ++ seq(fun t_map_field/1, Fs, ["}"]).
-t_map_field([K,V]) ->
+t_map_field(#xmlElement{content = [K,V]}) ->
[t_utype_elem(K) ++ " => " ++ t_utype_elem(V)].
t_fun(Es) ->
@@ -557,14 +556,12 @@ ot_type([#xmlElement{name = tuple, content = Es}]) ->
ot_tuple(Es);
ot_type([#xmlElement{name = map, content = Es}]) ->
ot_map(Es);
-ot_type([#xmlElement{name = map_field, content = Es}]) ->
- ot_map_field(Es);
ot_type([#xmlElement{name = 'fun', content = Es}]) ->
ot_fun(Es);
ot_type([#xmlElement{name = record, content = Es}]) ->
ot_record(Es);
ot_type([#xmlElement{name = abstype, content = Es}]) ->
- ot_abstype(Es);
+ ot_abstype(Es);
ot_type([#xmlElement{name = union, content = Es}]) ->
ot_union(Es).
@@ -616,10 +613,10 @@ ot_tuple(Es) ->
{type,0,tuple,[ot_utype_elem(E) || E <- Es]}.
ot_map(Es) ->
- {type,0,map,[ot_utype_elem(E) || E <- Es]}.
+ {type,0,map,[ot_map_field(E) || E <- get_elem(map_field,Es)]}.
-ot_map_field(Es) ->
- {type,0,map_field_assoc,[ot_utype_elem(E) || E <- Es]}.
+ot_map_field(#xmlElement{content=[K,V]}) ->
+ {type,0,map_field_assoc, ot_utype_elem(K), ot_utype_elem(V)}.
ot_fun(Es) ->
Range = ot_utype(get_elem(type, Es)),