diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-12-17 03:52:50 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-12-17 03:52:50 +0000 |
commit | cfa350c31aebe2e06611d0fbb41fe88b1f30b8e8 (patch) | |
tree | 9809a9c320538a793866f1ca7a408fe09679a902 /ocamldoc/odoc_ast.ml | |
parent | 024c8ad498a7c0fc35355c543d94a14bfd3fab51 (diff) |
merge generative functors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14365 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_ast.ml')
-rw-r--r-- | ocamldoc/odoc_ast.ml | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ocamldoc/odoc_ast.ml b/ocamldoc/odoc_ast.ml index 6f0a8d572..18e474a79 100644 --- a/ocamldoc/odoc_ast.ml +++ b/ocamldoc/odoc_ast.ml @@ -1606,18 +1606,25 @@ module Analyser = | (Parsetree.Pmod_functor (_, pmodule_type, p_module_expr2), Typedtree.Tmod_functor (ident, _, mtyp, tt_module_expr2)) -> - let loc_start = pmodule_type.Parsetree.pmty_loc.Location.loc_start.Lexing.pos_cnum in - let loc_end = pmodule_type.Parsetree.pmty_loc.Location.loc_end.Lexing.pos_cnum in + let loc = match pmodule_type with None -> Location.none + | Some pmty -> pmty.Parsetree.pmty_loc in + let loc_start = loc.Location.loc_start.Lexing.pos_cnum in + let loc_end = loc.Location.loc_end.Lexing.pos_cnum in let mp_type_code = get_string_of_file loc_start loc_end in print_DEBUG (Printf.sprintf "mp_type_code=%s" mp_type_code); let mp_name = Name.from_ident ident in - let mp_kind = Sig.analyse_module_type_kind env - current_module_name pmodule_type mtyp.mty_type + let mp_kind = + match pmodule_type, mtyp with + Some pmty, Some mty -> + Sig.analyse_module_type_kind env current_module_name pmty + mty.mty_type + | _ -> Module_type_struct [] in let param = { mp_name = mp_name ; - mp_type = Odoc_env.subst_module_type env mtyp.mty_type ; + mp_type = Misc.may_map + (fun m -> Odoc_env.subst_module_type env m.mty_type) mtyp ; mp_type_code = mp_type_code ; mp_kind = mp_kind ; } |