aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_pp.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-06-04 14:27:17 +0200
committerFredrik Gustafsson <[email protected]>2013-06-04 14:27:17 +0200
commit66c5325d80aaee54bda10ff0ebb4c79a4fea24d0 (patch)
tree7c265f4ba9cd6144050ccfa11ad0992e713ab6be /lib/stdlib/src/erl_pp.erl
parented22252022f5627bee92c0c2e45450c875ad5868 (diff)
parentbdb5769f2a5168a21e224a9833eb9aff5c5791b7 (diff)
downloadotp-66c5325d80aaee54bda10ff0ebb4c79a4fea24d0.tar.gz
otp-66c5325d80aaee54bda10ff0ebb4c79a4fea24d0.tar.bz2
otp-66c5325d80aaee54bda10ff0ebb4c79a4fea24d0.zip
Merge branch 'nox/erl_pp-callback/OTP-11140' into maint
* nox/erl_pp-callback/OTP-11140: Update primary bootstrap Support callback attributes in erl_pp
Diffstat (limited to 'lib/stdlib/src/erl_pp.erl')
-rw-r--r--lib/stdlib/src/erl_pp.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/stdlib/src/erl_pp.erl b/lib/stdlib/src/erl_pp.erl
index c0596e5ba6..657cb5d34c 100644
--- a/lib/stdlib/src/erl_pp.erl
+++ b/lib/stdlib/src/erl_pp.erl
@@ -214,7 +214,9 @@ lattribute({attribute,_Line,type,Type}, Opts, _State) ->
lattribute({attribute,_Line,opaque,Type}, Opts, _State) ->
[typeattr(opaque, Type, Opts),leaf(".\n")];
lattribute({attribute,_Line,spec,Arg}, _Opts, _State) ->
- [specattr(Arg),leaf(".\n")];
+ [specattr(spec, Arg),leaf(".\n")];
+lattribute({attribute,_Line,callback,Arg}, _Opts, _State) ->
+ [specattr(callback, Arg),leaf(".\n")];
lattribute({attribute,_Line,Name,Arg}, Opts, State) ->
[lattribute(Name, Arg, Opts, State),leaf(".\n")].
@@ -311,14 +313,14 @@ union_elem(T) ->
tuple_type(Ts, F) ->
{seq,${,$},[$,],ltypes(Ts, F)}.
-specattr({FuncSpec,TypeSpecs}) ->
+specattr(SpecKind, {FuncSpec,TypeSpecs}) ->
Func = case FuncSpec of
{F,_A} ->
format("~w", [F]);
{M,F,_A} ->
format("~w:~w", [M, F])
end,
- {first,leaf("-spec "),
+ {first,leaf(lists:concat(["-", SpecKind, " "])),
{list,[{first,leaf(Func),spec_clauses(TypeSpecs)}]}}.
spec_clauses(TypeSpecs) ->