aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_docgen
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <egil@erlang.org>2014-03-13 15:21:56 +0100
committerBjörn-Egil Dahlberg <egil@erlang.org>2014-03-13 15:21:56 +0100
commitff3a2c480b4f839cb2aa3c6f414155467a8a915e (patch)
tree31966373bb9e7279b59de6959a284749f1884a6a /lib/erl_docgen
parent349497c8c1588ab47757e2c244935a13ca404484 (diff)
parent398eeabee8a4522126aaa56899b9fe81ee884754 (diff)
downloadotp-ff3a2c480b4f839cb2aa3c6f414155467a8a915e.tar.gz
otp-ff3a2c480b4f839cb2aa3c6f414155467a8a915e.tar.bz2
otp-ff3a2c480b4f839cb2aa3c6f414155467a8a915e.zip
Merge branch 'nox/maps-erl_docgen/OTP-11776'
* nox/maps-erl_docgen/OTP-11776: Handle map types in docgen_edoc_xml_cb Handle nonempty list types in docgen_edoc_xml_cb
Diffstat (limited to 'lib/erl_docgen')
-rw-r--r--lib/erl_docgen/src/docgen_edoc_xml_cb.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
index e3cc354206..e6bf9ce20e 100644
--- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
+++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
@@ -1014,6 +1014,8 @@ t_type([#xmlElement{name = nil}]) ->
t_nil();
t_type([#xmlElement{name = list, content = Es}]) ->
t_list(Es);
+t_type([#xmlElement{name = nonempty_list, content = Es}]) ->
+ t_nonempty_list(Es);
t_type([#xmlElement{name = tuple, content = Es}]) ->
t_tuple(Es);
t_type([#xmlElement{name = 'fun', content = Es}]) ->
@@ -1023,7 +1025,11 @@ t_type([#xmlElement{name = abstype, content = Es}]) ->
t_type([#xmlElement{name = union, content = Es}]) ->
t_union(Es);
t_type([#xmlElement{name = record, content = Es}]) ->
- t_record(Es).
+ t_record(Es);
+t_type([#xmlElement{name = map, content = Es}]) ->
+ t_map(Es);
+t_type([#xmlElement{name = map_field, content = Es}]) ->
+ t_map_field(Es).
t_var(E) ->
[get_attrval(name, E)].
@@ -1046,6 +1052,9 @@ t_nil() ->
t_list(Es) ->
["["] ++ t_utype(get_elem(type, Es)) ++ ["]"].
+t_nonempty_list(Es) ->
+ ["["] ++ t_utype(get_elem(type, Es)) ++ [", ...]"].
+
t_tuple(Es) ->
["{"] ++ seq(fun t_utype_elem/1, Es, ["}"]).
@@ -1058,6 +1067,12 @@ t_record([E|Es]) ->
t_field(#xmlElement{name=field, content=[Atom,Type]}) ->
[get_attrval(value, Atom), "="] ++ t_utype_elem(Type).
+t_map(Es) ->
+ ["#{"] ++ seq(fun t_utype_elem/1, Es, ["}"]).
+
+t_map_field([K,V]) ->
+ [t_utype_elem(K) ++ " => " ++ t_utype_elem(V)].
+
t_abstype(Es) ->
case split_at_colon(t_name(get_elem(erlangName, Es)),[]) of
{Mod,Type} ->