aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_layout.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2015-05-22 14:59:05 +0200
committerHans Bolinder <[email protected]>2015-06-12 11:44:26 +0200
commitb4374be62fcb48ae404b4c7eedacb69ecb5442ad (patch)
tree330979c18404e15cb5174f0ff7c7fec09c328876 /lib/edoc/src/edoc_layout.erl
parentca1c1f8d1a4fe4f7b19b9959c48bd64915215f24 (diff)
downloadotp-b4374be62fcb48ae404b4c7eedacb69ecb5442ad.tar.gz
otp-b4374be62fcb48ae404b4c7eedacb69ecb5442ad.tar.bz2
otp-b4374be62fcb48ae404b4c7eedacb69ecb5442ad.zip
edoc: Add parentheses to Erlang types and specs when needed
Before OTP 18, parentheses are kept by the Erlang Parser, and converted by EDoc ('paren_type' to #t_paren{}). As of OTP 18, the parser no longer keeps parentheses, why EDoc needs to insert them when converting Erlang types and specs to EDoc types and specs. As it seems, it is only annotations that sometimes require parentheses.
Diffstat (limited to 'lib/edoc/src/edoc_layout.erl')
-rw-r--r--lib/edoc/src/edoc_layout.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl
index 62d5eb9a18..b67ec31ae3 100644
--- a/lib/edoc/src/edoc_layout.erl
+++ b/lib/edoc/src/edoc_layout.erl
@@ -520,7 +520,7 @@ format_spec(Name, Type, Defs, #opts{pretty_printer = erl_pp}=Opts) ->
{R, ".\n"} = etypef(L, O),
[{pre, R}]
catch _:_ ->
- %% Example: "@spec ... -> record(a)"
+ %% Should not happen.
format_spec(Name, Type, Defs, Opts#opts{pretty_printer=''})
end;
format_spec(Sep, Type, Defs, _Opts) ->