Ocamldoc: erase empty constructor comment

When a type definition exposes constructors, adding an empty
constructor comment just after the last constructor is the only way to
place a documentation comment after the type definition and still
attach this comment to the type definition.
However, this empty comment is still printed by most documentation
generators. To fix this aesthetic conundrum, this commit erases empty
constructor comments when constructing the associated
Odoc_type.variant_constructor and thus prevents any printing of these
empty comments.
master
octachron 2015-12-28 17:48:46 +01:00
parent 6533f3bc06
commit 9b161ab1ad
1 changed files with 3 additions and 1 deletions

View File

@ -288,7 +288,9 @@ module Analyser =
let f {Types.cd_id=constructor_name;cd_args;cd_res=ret_type} = let f {Types.cd_id=constructor_name;cd_args;cd_res=ret_type} =
let constructor_name = Ident.name constructor_name in let constructor_name = Ident.name constructor_name in
let comment_opt = let comment_opt =
try List.assoc constructor_name name_comment_list try match List.assoc constructor_name name_comment_list with
| Some { i_desc = None | Some []; _ } -> None
| x -> x
with Not_found -> None with Not_found -> None
in in
let vc_args = let vc_args =