aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_docgen/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-06-17 10:37:59 +0200
committerHans Bolinder <[email protected]>2016-07-07 08:39:49 +0200
commitffade10992fd0d529a11df967a221647156b427f (patch)
treec3fd76d8db8f88ba715967de89e615eaf0741bd4 /lib/erl_docgen/src
parent23e61520b5b824545d654e8e0d20aa78ac9ec522 (diff)
downloadotp-ffade10992fd0d529a11df967a221647156b427f.tar.gz
otp-ffade10992fd0d529a11df967a221647156b427f.tar.bz2
otp-ffade10992fd0d529a11df967a221647156b427f.zip
erl_docgen: Improve callback module for creating erlref
Create `Module:Type()' instead of `Type() (see module Module)'.
Diffstat (limited to 'lib/erl_docgen/src')
-rw-r--r--lib/erl_docgen/src/docgen_edoc_xml_cb.erl32
1 files changed, 11 insertions, 21 deletions
diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
index 0ac7985a48..cf3ca544a2 100644
--- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
+++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -563,7 +563,14 @@ otp_xmlify_a_fileref(FileRef1, AppS) ->
true ->
case split(Marker0, "-") of
[Func,Arity] ->
- Func++"/"++Arity;
+ try list_to_integer(Arity) of
+ _ ->
+ Func++"/"++Arity
+ catch
+ _:_ ->
+ %% This is "type-"<a-type>.
+ Marker0
+ end;
_ ->
Marker0
end
@@ -1075,25 +1082,8 @@ 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} ->
- [Type, "("] ++
- seq(fun t_utype_elem/1, get_elem(type, Es), [")"]) ++
- [" (see module ", Mod, ")"];
- Type ->
- [Type, "("] ++
- seq(fun t_utype_elem/1, get_elem(type, Es), [")"])
- end.
-
-%% Split at one colon, but not at two (or more)
-split_at_colon([$:,$:|_]=Rest,Acc) ->
- lists:reverse(Acc)++Rest;
-split_at_colon([$:|Type],Acc) ->
- {lists:reverse(Acc),Type};
-split_at_colon([Char|Rest],Acc) ->
- split_at_colon(Rest,[Char|Acc]);
-split_at_colon([],Acc) ->
- lists:reverse(Acc).
+ Name = t_name(get_elem(erlangName, Es)),
+ [Name, "("] ++ seq(fun t_utype_elem/1, get_elem(type, Es), [")"]).
t_union(Es) ->
seq(fun t_utype_elem/1, Es, " | ", []).