@@ -1638,6 +1638,23 @@ let pp_variadictype fmt name doc_pred ty args =
16381638 pp_comment doc name pp_ty_args args
16391639;;
16401640
1641+ let pp_variadicpred fmt docspec name doc_pred ty args =
1642+ let rargs = List. rev ((false , ty ^ " .. " ," ..." ) :: args) in
1643+ if is_std_moded rargs then
1644+ match docspec with
1645+ | DocNext ->
1646+ Fmt. fprintf fmt " @[<v 2>external func %s %% %s@;%a@]@."
1647+ name doc_pred pp_tab_args rargs
1648+ | DocAbove ->
1649+ let doc =
1650+ " [" ^ String. concat " " (name :: List. map (fun (_ ,_ ,x ) -> x) rargs) ^
1651+ " ] " ^ doc_pred in
1652+ Fmt. fprintf fmt " @[<v>%% %[email protected] func %s@[<hov>%a.@]@]@.@." 1653+ pp_comment doc name pp_args rargs
1654+ else
1655+ pp_variadictype fmt name doc_pred ty args
1656+ ;;
1657+
16411658let document_pred fmt docspec name ffi =
16421659 let rec doc
16431660 : type i o h c . (bool * string * string ) list -> (i ,o ,h ,c ) ffi -> unit
@@ -1653,8 +1670,8 @@ let document_pred fmt docspec name ffi =
16531670 | Full (_ ,s ) -> pp_pred fmt docspec name s args
16541671 | FullHO (_ ,s ) -> pp_pred fmt docspec name s args
16551672 | VariadicIn ( _ ,{ ContextualConversion. ty } , s ) -> pp_variadictype fmt name s (Conversion. show_ty_ast ty) args
1656- | VariadicOut ( _ ,{ ContextualConversion. ty } , s ) -> pp_variadictype fmt name s (Conversion. show_ty_ast ty) args
1657- | VariadicInOut ( _ ,{ ContextualConversion. ty } , s ) -> pp_variadictype fmt name s (Conversion. show_ty_ast ty) args
1673+ | VariadicOut ( _ ,{ ContextualConversion. ty } , s ) -> pp_variadicpred fmt docspec name s (Conversion. show_ty_ast ty) args
1674+ | VariadicInOut ( _ ,{ ContextualConversion. ty } , s ) -> pp_variadicpred fmt docspec name s (Conversion. show_ty_ast ty) args
16581675 in
16591676 doc [] ffi
16601677;;
0 commit comments