diff options
| author | Alain Frisch <alain@frisch.fr> | 2014-09-04 16:22:44 +0000 |
|---|---|---|
| committer | Alain Frisch <alain@frisch.fr> | 2014-09-04 16:22:44 +0000 |
| commit | 28afbb4d2334bf0cd9bde9c1ce439b9fec4d3445 (patch) | |
| tree | b41f3da5f1c9055d4ccceb68639782615968584b | |
| parent | 7740036108fc7c8bb1a7e22cfd5a73dc91244f57 (diff) | |
| download | ocaml-28afbb4d2334bf0cd9bde9c1ce439b9fec4d3445.tar.gz | |
Make ocamldoc compile (still need support for inlined records).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15192 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| -rw-r--r-- | ocamldoc/odoc_ast.ml | 10 | ||||
| -rw-r--r-- | ocamldoc/odoc_sig.ml | 21 |
2 files changed, 28 insertions, 3 deletions
diff --git a/ocamldoc/odoc_ast.ml b/ocamldoc/odoc_ast.ml index 358a71a51c..346db02455 100644 --- a/ocamldoc/odoc_ast.ml +++ b/ocamldoc/odoc_ast.ml @@ -1316,6 +1316,11 @@ module Analyser = let new_xt = match tt_ext.ext_kind with Text_decl(args, ret_type) -> + let args = + match args with + | Cstr_tuple l -> l + | Cstr_record _ -> assert false + in { xt_name = complete_name; xt_args = @@ -1373,6 +1378,11 @@ module Analyser = Text_decl(tt_args, tt_ret_type) -> let loc_start = loc.Location.loc_start.Lexing.pos_cnum in let loc_end = loc.Location.loc_end.Lexing.pos_cnum in + let tt_args = + match tt_args with + | Cstr_tuple l -> l + | Cstr_record _ -> assert false + in { ex_name = complete_name ; ex_info = comment_opt ; diff --git a/ocamldoc/odoc_sig.ml b/ocamldoc/odoc_sig.ml index e41cf2b8db..8a15841b1a 100644 --- a/ocamldoc/odoc_sig.ml +++ b/ocamldoc/odoc_sig.ml @@ -271,12 +271,17 @@ module Analyser = Types.Type_abstract -> Odoc_type.Type_abstract | Types.Type_variant l -> - let f {Types.cd_id=constructor_name;cd_args=type_expr_list;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 comment_opt = try List.assoc constructor_name name_comment_list with Not_found -> None in + let type_expr_list = + match cd_args with + | Cstr_tuple l -> l + | Cstr_record _ -> assert false + in { vc_name = constructor_name ; vc_args = List.map (Odoc_env.subst_type env) type_expr_list ; @@ -658,10 +663,15 @@ module Analyser = [] -> (maybe_more, List.rev exts_acc) | (name, types_ext) :: q -> let ext_loc_end = types_ext.Types.ext_loc.Location.loc_end.Lexing.pos_cnum in + let args = + match types_ext.ext_args with + | Cstr_tuple l -> l + | Cstr_record _ -> assert false + in let new_x = { xt_name = Name.concat current_module_name name ; - xt_args = List.map (Odoc_env.subst_type new_env) types_ext.ext_args ; + xt_args = List.map (Odoc_env.subst_type new_env) args; xt_ret = may_map (Odoc_env.subst_type new_env) types_ext.ext_ret_type ; xt_type_extension = new_te; xt_alias = None ; @@ -696,11 +706,16 @@ module Analyser = with Not_found -> raise (Failure (Odoc_messages.exception_not_found current_module_name name.txt)) in + let args = + match types_ext.ext_args with + | Cstr_tuple l -> l + | Cstr_record _ -> assert false + in let e = { ex_name = Name.concat current_module_name name.txt ; ex_info = comment_opt ; - ex_args = List.map (Odoc_env.subst_type env) types_ext.ext_args ; + ex_args = List.map (Odoc_env.subst_type env) args; ex_ret = may_map (Odoc_env.subst_type env) types_ext.ext_ret_type ; ex_alias = None ; ex_loc = { loc_impl = None ; loc_inter = Some sig_item_loc } ; |
