Commits

camlspotter committed 03d8843

removed modulesig

Comments (0)

Files changed (6)

     ident
     env
     file
-    modulesig
     deb
     vm
     module
         end
     | Lam.Top.Load name ->
         let ident = Ident.create name in
-        let sg = Modulesig.load_file (name ^ File.ext_signature) in
+        let sg = Env.load_file (name ^ File.ext_signature) in
         (ident, Env.Module sg) :: env, Load ident
 
   let defined_idents = function
 
 type desc = 
   | Value
-  | Module of (Ident.t * desc) list
-with sexp
+  | Module of t
 
-type t = (Ident.t * desc) list 
+and t = (Ident.t * desc) list 
 with sexp
     
 let rec search_by_name pos s = function
   | _::xs -> search_by_ident (pos+1) id xs
 
 let search_by_ident id = search_by_ident 0 id
+
+let load_file = Misc.load_file_via_sexp t_of_sexp
+let save_file = Misc.save_file_via_sexp sexp_of_t
       let dir, body, _ext = File.parse_path file in
       let tops = Lam.Top.load file in
       let module_ = Module.compile [] tops body in
-      Modulesig.save_file (dir ^ "/" ^ body ^ File.ext_signature) module_.Module.signature;
+      Env.save_file (dir ^ "/" ^ body ^ File.ext_signature) module_.Module.signature;
       Module.save_file (dir ^ "/" ^ body ^ File.ext_object) module_;
       Format.eprintf "%a@." Sexplib.Sexp.pp_hum (Module.sexp_of_t module_);
     ) files
 open Vm
 
 type t = {
-  signature : Modulesig.t;
+  signature : DEnv.t;
   code : Vm.Code.t array;
 } with sexp
 

modulesig.ml

-open Sexplib.Conv
-
-type t = (Ident.t * Env.desc) list (** kind of signature of module *)
-with sexp
-
-let load_file = Misc.load_file_via_sexp t_of_sexp
-let save_file = Misc.save_file_via_sexp sexp_of_t