diff -Naur ocaml-3.09.2/ocamldoc/odoc_env.ml ocaml-3.09.2-extsig/ocamldoc/odoc_env.ml --- ocaml-3.09.2/ocamldoc/odoc_env.ml 2004-06-12 11:55:46.000000000 +0300 +++ ocaml-3.09.2-extsig/ocamldoc/odoc_env.ml 2006-07-19 20:29:17.000000000 +0300 @@ -66,7 +66,8 @@ match modtype_decl with Types.Tmodtype_abstract -> env - | Types.Tmodtype_manifest modtype -> + | Types.Tmodtype_manifest modtype + | Types.Tmodtype_external modtype -> match modtype with (* A VOIR : le cas oł c'est un identificateur, dans ce cas on n'a pas de signature *) Types.Tmty_signature s -> add_signature env (qualify ident) ~rel: (rel_name ident) s diff -Naur ocaml-3.09.2/stdlib/sys.ml ocaml-3.09.2-extsig/stdlib/sys.ml --- ocaml-3.09.2/stdlib/sys.ml 2006-04-14 12:53:48.000000000 +0300 +++ ocaml-3.09.2-extsig/stdlib/sys.ml 2006-07-19 20:52:26.000000000 +0300 @@ -78,4 +78,4 @@ (* OCaml version string, must be in the format described in sys.mli. *) -let ocaml_version = "3.09.2";; +let ocaml_version = "3.09.2+extsigs";; diff -Naur ocaml-3.09.2/typing/env.ml ocaml-3.09.2-extsig/typing/env.ml --- ocaml-3.09.2/typing/env.ml 2005-08-13 23:59:37.000000000 +0300 +++ ocaml-3.09.2-extsig/typing/env.ml 2006-07-19 20:33:18.000000000 +0300 @@ -254,7 +254,8 @@ let find_modtype_expansion path env = match find_modtype path env with Tmodtype_abstract -> raise Not_found - | Tmodtype_manifest mty -> mty + | Tmodtype_manifest mty + | Tmodtype_external mty -> mty let find_module path env = match path with @@ -342,6 +343,28 @@ raise Not_found end +let lookup_module_type proj1 proj2 lid env = + match lid with + Lident s -> + begin try + Ident.find_name s (proj1 env) + with Not_found -> + if s = !current_unit then raise Not_found; + let ps = find_pers_struct s in + (Pident(Ident.create s), Types.Tmodtype_external(Types.Tmty_signature ps.ps_sig)) + end + | Ldot(l, s) -> + let (p, desc) = lookup_module_descr l env in + begin match Lazy.force desc with + Structure_comps c -> + let (data, pos) = Tbl.find s (proj2 c) in + (Pdot(p, s, pos), data) + | Functor_comps f -> + raise Not_found + end + | Lapply(l1, l2) -> + raise Not_found + let lookup proj1 proj2 lid env = match lid with Lident s -> @@ -383,7 +406,7 @@ and lookup_type = lookup (fun env -> env.types) (fun sc -> sc.comp_types) and lookup_modtype = - lookup (fun env -> env.modtypes) (fun sc -> sc.comp_modtypes) + lookup_module_type (fun env -> env.modtypes) (fun sc -> sc.comp_modtypes) and lookup_class = lookup (fun env -> env.classes) (fun sc -> sc.comp_classes) and lookup_cltype = diff -Naur ocaml-3.09.2/typing/includemod.ml ocaml-3.09.2-extsig/typing/includemod.ml --- ocaml-3.09.2/typing/includemod.ml 2005-08-13 23:59:37.000000000 +0300 +++ ocaml-3.09.2-extsig/typing/includemod.ml 2006-07-19 20:43:55.000000000 +0300 @@ -283,6 +283,14 @@ check_modtype_equiv env mty1 mty2 | (Tmodtype_abstract, Tmodtype_manifest mty2) -> check_modtype_equiv env (Tmty_ident(Pident id)) mty2 + | (Tmodtype_external mty1, Tmodtype_abstract) -> () + | (Tmodtype_external mty1, Tmodtype_external mty2) + | (Tmodtype_external mty1, Tmodtype_manifest mty2) + | (Tmodtype_manifest mty1, Tmodtype_external mty2) -> + check_modtype_equiv env mty1 mty2 + | (Tmodtype_abstract, Tmodtype_external mty2) -> + check_modtype_equiv env (Tmty_ident(Pident id)) mty2 + with Error reasons -> raise(Error(Modtype_infos(id, info1, info2) :: reasons)) diff -Naur ocaml-3.09.2/typing/mtype.ml ocaml-3.09.2-extsig/typing/mtype.ml --- ocaml-3.09.2/typing/mtype.ml 2005-09-28 10:18:30.000000000 +0300 +++ ocaml-3.09.2-extsig/typing/mtype.ml 2006-07-19 20:36:17.000000000 +0300 @@ -66,7 +66,8 @@ match decl with Tmodtype_abstract -> Tmodtype_manifest(Tmty_ident(Pdot(p, Ident.name id, nopos))) - | Tmodtype_manifest _ -> + | Tmodtype_manifest _ + | Tmodtype_external _ -> decl in Tsig_modtype(id, newdecl) :: strengthen_sig (Env.add_modtype id decl env) rem p @@ -130,6 +131,8 @@ and nondep_modtype_decl = function Tmodtype_abstract -> Tmodtype_abstract | Tmodtype_manifest mty -> Tmodtype_manifest(nondep_mty Strict mty) + | Tmodtype_external mty -> Tmodtype_external(nondep_mty Strict mty) + in nondep_mty Co mty diff -Naur ocaml-3.09.2/typing/printtyp.ml ocaml-3.09.2-extsig/typing/printtyp.ml --- ocaml-3.09.2/typing/printtyp.ml 2006-02-09 03:19:26.000000000 +0200 +++ ocaml-3.09.2-extsig/typing/printtyp.ml 2006-07-19 20:36:55.000000000 +0300 @@ -812,7 +812,8 @@ let mty = match decl with | Tmodtype_abstract -> Omty_abstract - | Tmodtype_manifest mty -> tree_of_modtype mty + | Tmodtype_manifest mty + | Tmodtype_external mty -> tree_of_modtype mty in Osig_modtype (Ident.name id, mty) diff -Naur ocaml-3.09.2/typing/subst.ml ocaml-3.09.2-extsig/typing/subst.ml --- ocaml-3.09.2/typing/subst.ml 2005-12-05 15:18:43.000000000 +0200 +++ ocaml-3.09.2-extsig/typing/subst.ml 2006-07-19 20:37:29.000000000 +0300 @@ -295,3 +295,4 @@ and modtype_declaration s = function Tmodtype_abstract -> Tmodtype_abstract | Tmodtype_manifest mty -> Tmodtype_manifest(modtype s mty) + | Tmodtype_external mty -> Tmodtype_external(modtype s mty) diff -Naur ocaml-3.09.2/typing/typemod.ml ocaml-3.09.2-extsig/typing/typemod.ml --- ocaml-3.09.2/typing/typemod.ml 2005-08-08 12:41:51.000000000 +0300 +++ ocaml-3.09.2-extsig/typing/typemod.ml 2006-07-19 20:39:27.000000000 +0300 @@ -269,8 +269,11 @@ match smty.pmty_desc with Pmty_ident lid -> begin try - let (path, info) = Env.lookup_modtype lid env in - Tmty_ident path + let (path, info) = Env.lookup_modtype lid env in begin + match info with + Tmodtype_external s -> s + | _ -> Tmty_ident path + end with Not_found -> raise(Error(smty.pmty_loc, Unbound_modtype lid)) end diff -Naur ocaml-3.09.2/typing/types.ml ocaml-3.09.2-extsig/typing/types.ml --- ocaml-3.09.2/typing/types.ml 2004-12-09 14:40:53.000000000 +0200 +++ ocaml-3.09.2-extsig/typing/types.ml 2006-07-19 20:40:19.000000000 +0300 @@ -194,6 +194,7 @@ and modtype_declaration = Tmodtype_abstract | Tmodtype_manifest of module_type + | Tmodtype_external of module_type and rec_status = Trec_not diff -Naur ocaml-3.09.2/typing/types.mli ocaml-3.09.2-extsig/typing/types.mli --- ocaml-3.09.2/typing/types.mli 2004-12-09 14:40:53.000000000 +0200 +++ ocaml-3.09.2-extsig/typing/types.mli 2006-07-19 20:40:31.000000000 +0300 @@ -196,6 +196,7 @@ and modtype_declaration = Tmodtype_abstract | Tmodtype_manifest of module_type + | Tmodtype_external of module_type and rec_status = Trec_not (* not recursive *)