diff options
-rw-r--r-- | lib/test_server/src/erl2html2.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/test_server/src/erl2html2.erl b/lib/test_server/src/erl2html2.erl index 7cfaa2c325..83e4dbc3eb 100644 --- a/lib/test_server/src/erl2html2.erl +++ b/lib/test_server/src/erl2html2.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2013. All Rights Reserved. +%% Copyright Ericsson AB 1997-2015. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -118,8 +118,9 @@ parse_preprocessed_file(Epp,File,InCorrectFile) -> {attribute,_,file,{_OtherFile,_}} -> parse_preprocessed_file(Epp,File,false); {function,L,F,A,[_|C]} when InCorrectFile -> - Clauses = [{clause,CL} || {clause,CL,_,_,_} <- C], - [{atom_to_list(F),A,L} | Clauses] ++ + Clauses = [{clause,get_line(CL)} || + {clause,CL,_,_,_} <- C], + [{atom_to_list(F),A,get_line(L)} | Clauses] ++ parse_preprocessed_file(Epp,File,true); _ -> parse_preprocessed_file(Epp,File,InCorrectFile) @@ -147,8 +148,9 @@ parse_non_preprocessed_file(Epp, File, Location) -> {ok,Tree,Location1} -> try erl_syntax:revert(Tree) of {function,L,F,A,[_|C]} -> - Clauses = [{clause,CL} || {clause,CL,_,_,_} <- C], - [{atom_to_list(F),A,L} | Clauses] ++ + Clauses = [{clause,get_line(CL)} || + {clause,CL,_,_,_} <- C], + [{atom_to_list(F),A,get_line(L)} | Clauses] ++ parse_non_preprocessed_file(Epp, File, Location1); _ -> parse_non_preprocessed_file(Epp, File, Location1) @@ -161,6 +163,9 @@ parse_non_preprocessed_file(Epp, File, Location) -> [] end. +get_line(Anno) -> + erl_anno:line(Anno). + %%%----------------------------------------------------------------- %%% Add a link target for each line and one for each function definition. build_html(SFd,DFd,Encoding,Functions) -> |