aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_extract.erl
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2011-09-28 15:00:19 +0200
committerHenrik Nord <[email protected]>2011-09-28 15:02:54 +0200
commitae097a5161b79f16f8b9a2d8f73e5e2f1792edec (patch)
treecbf278b965e5ad7fbe95bea524ea9580c2942684 /lib/edoc/src/edoc_extract.erl
parentfde38fa8d3120e6aa479f7720654114df9cd4ec8 (diff)
parentdf2063c1e436cfb2bb9283df074c4eaa87aeec91 (diff)
downloadotp-ae097a5161b79f16f8b9a2d8f73e5e2f1792edec.tar.gz
otp-ae097a5161b79f16f8b9a2d8f73e5e2f1792edec.tar.bz2
otp-ae097a5161b79f16f8b9a2d8f73e5e2f1792edec.zip
Merge branch 'rc/edoc-0.7.9' into dev
* rc/edoc-0.7.9: bumped revision removed some never-matching clauses reported by dialyzer Fix macro expansion in comments following Erlang types URI-escape bytes as two hex digits always (reported by Alfonso De Gregorio) updated author e-mail recognize some more URI schemas in wiki text, in particular https OTP-9590
Diffstat (limited to 'lib/edoc/src/edoc_extract.erl')
-rw-r--r--lib/edoc/src/edoc_extract.erl17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/edoc/src/edoc_extract.erl b/lib/edoc/src/edoc_extract.erl
index 1209d86fe5..5a79e127f6 100644
--- a/lib/edoc/src/edoc_extract.erl
+++ b/lib/edoc/src/edoc_extract.erl
@@ -15,7 +15,7 @@
%% USA
%%
%% @copyright 2001-2003 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @see edoc
%% @end
%% =====================================================================
@@ -75,7 +75,7 @@ source(Forms, Comments, File, Env, Opts) when is_list(Forms) ->
source(Forms1, Comments, File, Env, Opts);
source(Forms, Comments, File, Env, Opts) ->
Tree = erl_recomment:quick_recomment_forms(Forms, Comments),
- TypeDocs = find_type_docs(Forms, Comments),
+ TypeDocs = find_type_docs(Forms, Comments, Env, File),
source1(Tree, File, Env, Opts, TypeDocs).
%% @spec source(Forms, File::filename(), Env::edoc_env(),
@@ -111,7 +111,7 @@ source(Forms, Comments, File, Env, Opts) ->
source(Forms, File, Env, Opts) when is_list(Forms) ->
source(erl_syntax:form_list(Forms), File, Env, Opts);
source(Tree, File0, Env, Opts) ->
- TypeDocs = find_type_docs(Tree, []),
+ TypeDocs = find_type_docs(Tree, [], Env, File0),
source1(Tree, File0, Env, Opts, TypeDocs).
%% Forms0 and Comments is used for extracting Erlang type documentation.
@@ -635,14 +635,17 @@ file_macros(_Context, Env) ->
%% The same thing using -type:
%% -type t() :: t1(). % Some docs of t/0;
%% Further docs of t/0.
-find_type_docs(Forms0, Comments) ->
+find_type_docs(Forms0, Comments, Env, File) ->
Tree = erl_recomment:recomment_forms(Forms0, Comments),
Forms = preprocess_forms(Tree),
- edoc_specs:docs(Forms, fun find_fun/2).
+ Env1 = add_macro_defs(edoc_macros:std_macros(Env), [], Env),
+ F = fun(C, Line) -> find_fun(C, Line, Env1, File) end,
+ edoc_specs:docs(Forms, F).
-find_fun(C0, Line) ->
+find_fun(C0, Line, Env, File) ->
C1 = comment_text(C0),
Text = lists:append([C#comment.text || C <- C1]),
Comm = #comment{line = Line, text = Text},
[Tag | _] = scan_tags([Comm]),
- Tag.
+ [Tag1] = edoc_macros:expand_tags([Tag], Env, File),
+ Tag1.