From b4374be62fcb48ae404b4c7eedacb69ecb5442ad Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Fri, 22 May 2015 14:59:05 +0200 Subject: 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. --- lib/edoc/src/edoc_layout.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/edoc/src/edoc_layout.erl') 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) -> -- cgit v1.2.3