camlspotter avatar camlspotter committed 142de67

load_path was not set

Comments (0)

Files changed (11)

 locident.cmi :
 name.cmi :
 pathreparse.cmi : spot.cmi
-spot.cmi :
+spot.cmi : utils.cmi
 spotconfig.cmi : spotconfig_intf.cmo
 spoteval.cmi : utils.cmi spot.cmi
 spotfile.cmi : spoteval.cmi spotconfig_intf.cmo spot.cmi
 xset.cmi :
 checksum.cmo :
 checksum.cmx :
-cmt.cmo :
-cmt.cmx :
+cmt.cmo : utils.cmi
+cmt.cmx : utils.cmx
 command.cmo : command.cmi
 command.cmx : command.cmi
 dotfile.cmo : utils.cmi
 name.cmo : name.cmi
 name.cmx : name.cmi
 ocamlspot.cmo : utils.cmi typeexpand.cmi spotfile.cmi spoteval.cmi \
-    spotconfig.cmi spot.cmi pathreparse.cmi ext.cmo command.cmi
+    spotconfig.cmi spot.cmi pathreparse.cmi ext.cmo command.cmi cmt.cmo
 ocamlspot.cmx : utils.cmx typeexpand.cmx spotfile.cmx spoteval.cmx \
-    spotconfig.cmx spot.cmx pathreparse.cmx ext.cmx command.cmx
+    spotconfig.cmx spot.cmx pathreparse.cmx ext.cmx command.cmx cmt.cmx
 pathreparse.cmo : utils.cmi spot.cmi locident.cmi ext.cmo pathreparse.cmi
 pathreparse.cmx : utils.cmx spot.cmx locident.cmx ext.cmx pathreparse.cmi
 spot.cmo : utils.cmi ttfold.cmi treeset.cmi ext.cmo cmt.cmo checksum.cmo \
 spoteval.cmo : utils.cmi spot.cmi ext.cmo spoteval.cmi
 spoteval.cmx : utils.cmx spot.cmx ext.cmx spoteval.cmi
 spotfile.cmo : utils.cmi spoteval.cmi spotconfig_intf.cmo spot.cmi \
-    dotfile.cmo spotfile.cmi
+    dotfile.cmo cmt.cmo spotfile.cmi
 spotfile.cmx : utils.cmx spoteval.cmx spotconfig_intf.cmx spot.cmx \
-    dotfile.cmx spotfile.cmi
+    dotfile.cmx cmt.cmx spotfile.cmi
 treeset.cmo : xset.cmi treeset.cmi
 treeset.cmx : xset.cmx treeset.cmi
 ttfold.cmo : ttfold.cmi
         | Tsig_include (mty, sg) -> 
             let loc = si.sig_loc in
             let m = Abstraction.module_type mty in
-            let sg0 = try match Mtype.scrape mty.mty_env mty.mty_type with Types.Mty_signature sg -> sg | _ -> assert false with _ -> assert false in
+            let sg0 = match Mtype.scrape mty.mty_env mty.mty_type with 
+              | Types.Mty_signature sg -> sg 
+              | Types.Mty_functor _ -> assert false
+              | Types.Mty_ident _path -> 
+                  (* Strange... failed to scrape? *)
+                  assert false
+            in
             let ids = List.map (fun si -> snd (T.kident_of_sigitem si)) sg in
             let aliases = try aliases_of_include' false sg0 ids with _ -> assert false in
             List.iter (fun (id, (k, id')) -> 
     | Partial_implementation _parts | Partial_interface _parts -> assert false
   
   let abstraction cmt = 
-    try abstraction cmt with e -> 
-      Format.eprintf "Aiee %s@." (Printexc.to_string e);
-      raise e
+    with_ref Config.load_path cmt.cmt_loadpath (fun () -> 
+      try abstraction cmt; with e -> 
+        Format.eprintf "Aiee %s@." (Printexc.to_string e);
+        raise e)
 
   let of_cmt path (* the cmt file path *) cmt =
     let path = Option.default (Cmt.source_path cmt) (fun () -> 
 bigmodtest.cmi : target.cmo
 class.cmi :
 class2.cmi :
+include_sig.cmi : included_sig2.cmo included_sig.cmi
+included_sig.cmi :
 open_in_mli.cmi : target.cmo
 siginclude.cmi :
 siginclude2.cmi :
 included.cmx :
 included_and_flat.cmo :
 included_and_flat.cmx :
+included_sig2.cmo :
+included_sig2.cmx :
 included_value.cmo :
 included_value.cmx :
 including.cmo : included.cmo

tests/Makefile.targets

 include_functor_app.cmo \
 include_modtype.cmo \
 include_override.cmo \
+include_sig.cmi \
 included.cmo \
 included_and_flat.cmo \
+included_sig.cmi \
+included_sig2.cmo \
 included_value.cmo \
 including.cmo \
 inherit.cmo \

tests/include_sig.mli

+include Included_sig.S (* ? S1 *)
+include Included_sig2.S (* ? S2 *)

tests/included_sig.mli

+module type (* S1 => *) S (* <= S1 *) = sig
+  val x : int
+end

tests/included_sig2.ml

+module type (* S2 => *) S (* <= S2 *) = sig
+  val x : int
+end
 let failwithf fmt = Printf.kprintf failwith fmt
 let invalid_argf fmt = Printf.kprintf invalid_arg fmt
 
+let with_ref r v f =
+  let back_v = !r in
+  r := v;
+  protect ~f () ~finally:(fun () -> r := back_v)
+
 module Unix = struct
   include Unix
 
 val protect : f:('a -> 'b) -> 'a -> finally:('a -> unit) -> 'b
 val failwithf : ('a, unit, string, 'b) format4 -> 'a
 val invalid_argf : ('a, unit, string, 'b) format4 -> 'a
+val with_ref : 'a ref -> 'a -> (unit -> 'b) -> 'b
 
 module Unix : sig
   include module type of Unix
 
 (* extend the original module *)
 open Path
+module Ident0 = Ident
 module Ident = struct
   include Ident
   include Xident
 open Format
 let format ppf p = pp_print_string ppf (name p)
 
+let rec to_longident = 
+  let open Longident in
+  function
+  | Pident id -> Lident (Ident0.name id )
+  | Pdot (p, name, _) -> Ldot (to_longident p, name)
+  | Papply (p1, p2) -> Lapply (to_longident p1, to_longident p2)
     (** return true if "local" *)
 val parse : Name.t -> t
 val format : Format.formatter -> t -> unit
+
+val to_longident : t -> Longident.t
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.