camlspotter avatar camlspotter committed 8a464cf

cleanup

Comments (0)

Files changed (1)

 
   let check_time_stamp ~cmt source =
     (* CR jfuruse: aaa.mll creates cmt with aaa.ml as source, but
-       aaa.ml often does not exist.
+       aaa.ml is often removed by the build system.
     *)
     let stat_cmt = Unix.stat cmt in
     try
 include Load
 
 let initial_env file =
-  { Env.path = file.Unit.path;
-    cwd = file.Unit.builddir;
+  { Env.path   = file.Unit.path;
+    cwd        = file.Unit.builddir;
     load_paths = file.Unit.loadpath;
-    binding = Binding.predef }
+    binding    = Binding.predef }
 
 let invalid_env file =
-  { Env.path = file.Unit.path;
-    cwd = file.Unit.builddir;
+  { Env.path   = file.Unit.path;
+    cwd        = file.Unit.builddir;
     load_paths = file.Unit.loadpath;
-    binding = Binding.invalid }
+    binding    = Binding.invalid }
     
 type result =
     | File_itself
   
   let eval_and_find path =
     (* we need evaluate the path *)
+    let module V = Value in
     let v = !!(Eval.find_path env path) in
-    Debug.format "Value=%a@." Value.Format.t v;
+    Debug.format "Value=%a@." V.Format.t v;
     match v with
-    | Value.Ident id -> id, find_loc id
-    | Value.Parameter id -> id, find_loc id
-    | Value.Structure (id, _, _)  -> id, find_loc id
-    | Value.Closure (id, _, _, _, _) -> id, find_loc id
-    | Value.Error (Failure _ as e) -> raise e
-    | Value.Error (Load.Old_cmt _ as exn) -> raise exn
-    | Value.Error exn -> raise exn
+    | V.Ident id                      -> id, find_loc id
+    | V.Parameter id                  -> id, find_loc id
+    | V.Structure (id, _, _)          -> id, find_loc id
+    | V.Closure (id, _, _, _, _)      -> id, find_loc id
+    | V.Error (Failure _ as e)        -> raise e
+    | V.Error (Load.Old_cmt _ as exn) -> raise exn
+    | V.Error exn                     -> raise exn
   in
   eval_and_find path
 
                   None (* packed has no .mli *))
 
 let _ = Eval.packed := eval_packed
-
-(*
-  let dump_elem = function
-    | Source_path (Some s) -> eprintf "Source_path: %s@." s
-    | Source_path None -> eprintf "Source_path: None@." 
-    | Cwd s -> eprintf "Cwd: %s@." s 
-    | Load_paths ds -> 
-        eprintf "Load_paths: @[%a@]@."
-          (Format.list "; " (fun ppf s -> fprintf ppf "%S" s)) ds
-    | Argv argv ->
-        eprintf "Argv: @[%a@]@."
-          (Format.list "; " (fun ppf s -> fprintf ppf "%S" s)) 
-            (Array.to_list argv)
-    | Top None -> eprintf "Top None@."
-    | Top (Some str) -> 
-        eprintf "@[<2>Top@ %a@]@."
-          format_structure str
-    | Annots _ -> eprintf "Annots [...]@."
-
-  let dump_elems elems = List.iter dump_elem elems
-*)
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.