aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_layout.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-30 12:23:45 +0200
committerBjörn Gustavsson <[email protected]>2015-04-30 12:23:45 +0200
commita5c6199d194b47c4385083d5aca35807c50c1549 (patch)
treec7edf5193895d6252e3dbd61ee48746d0de2b942 /lib/edoc/src/edoc_layout.erl
parent147e8b9bd0b36315f0d8bd38e39c51d93cd9f509 (diff)
parenta1f9b09e47dfa56957c36b39d3d3e541c7cd9d19 (diff)
downloadotp-a5c6199d194b47c4385083d5aca35807c50c1549.tar.gz
otp-a5c6199d194b47c4385083d5aca35807c50c1549.tar.bz2
otp-a5c6199d194b47c4385083d5aca35807c50c1549.zip
Merge branch 'hb/line_abstraction/OTP-12195'
* hb/line_abstraction/OTP-12195: (21 commits) Ensure that erl_anno is used when building the primary bootstrap erl_docgen: Use module erl_anno wx: Use module erl_anno diameter: Use module erl_anno dialyzer: Use module erl_anno eunit: Use module erl_anno hipe: Use module erl_anno edoc: Use module erl_anno syntax_tools: Use module erl_anno test_server: Use module erl_anno tools: Use module erl_anno parsetools: Use module erl_anno kernel: Use module erl_anno asn1: Use module erl_anno debugger: Use module erl_anno stdlib: Silence some of qlc's warnings stdlib: Use module erl_anno compiler: Use module erl_anno emulator: Use module erl_anno Update primary bootstrap ...
Diffstat (limited to 'lib/edoc/src/edoc_layout.erl')
-rw-r--r--lib/edoc/src/edoc_layout.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl
index 6309e88475..62d5eb9a18 100644
--- a/lib/edoc/src/edoc_layout.erl
+++ b/lib/edoc/src/edoc_layout.erl
@@ -535,7 +535,8 @@ t_clause(Name, Type) ->
pp_clause(Pre, Type) ->
Types = ot_utype([Type]),
Atom = lists:duplicate(iolist_size(Pre), $a),
- L1 = erl_pp:attribute({attribute,0,spec,{{list_to_atom(Atom),0},[Types]}}),
+ Attr = {attribute,0,spec,{{list_to_atom(Atom),0},[Types]}},
+ L1 = erl_pp:attribute(erl_parse:new_anno(Attr)),
"-spec " ++ L2 = lists:flatten(L1),
L3 = Pre ++ lists:nthtail(length(Atom), L2),
re:replace(L3, "\n ", "\n", [{return,list},global]).
@@ -555,7 +556,8 @@ format_type(Prefix, _Name, Type, Last, _Opts) ->
pp_type(Prefix, Type) ->
Atom = list_to_atom(lists:duplicate(iolist_size(Prefix), $a)),
- L1 = erl_pp:attribute({attribute,0,type,{Atom,ot_utype(Type),[]}}),
+ Attr = {attribute,0,type,{Atom,ot_utype(Type),[]}},
+ L1 = erl_pp:attribute(erl_parse:new_anno(Attr)),
{L2,N} = case lists:dropwhile(fun(C) -> C =/= $: end, lists:flatten(L1)) of
":: " ++ L3 -> {L3,9}; % compensation for extra "()" and ":"
"::\n" ++ L3 -> {"\n"++L3,6}
@@ -1085,8 +1087,8 @@ ot_var(E) ->
{var,0,list_to_atom(get_attrval(name, E))}.
ot_atom(E) ->
- {ok, [Atom], _} = erl_scan:string(get_attrval(value, E), 0),
- Atom.
+ {ok, [{atom,A,Name}], _} = erl_scan:string(get_attrval(value, E), 0),
+ {atom,erl_anno:line(A),Name}.
ot_integer(E) ->
{integer,0,list_to_integer(get_attrval(value, E))}.