]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/binaries/transcript/engine.ml
using the new by foo we proved semantics
[helm.git] / helm / software / components / binaries / transcript / engine.ml
index f4b0c1e3747c4b616ca7e4ad6b3b45aaaa411dbb..120d31fdd3ffa2da105e152a96a7cd81c62c608d 100644 (file)
  * http://cs.unibo.it/helm/.
  *)
 
-module R = Helm_registry
-module X = HExtlib
-module T = Types
-module G = Grafite
+module R  = Helm_registry
+module X  = HExtlib
+module T  = Types
+module G  = Grafite
+module HP = Http_getter
+
+module O = Options
 
 type script = {
    name    : string;
@@ -88,9 +91,12 @@ let set_requires st =
 let init () = 
    let transcript_dir = Filename.dirname Sys.argv.(0) in
    let default_registry = Filename.concat transcript_dir "transcript" in
-   load_registry default_registry
+   let matita_registry = Filename.concat !O.cwd "matita" in
+   load_registry default_registry;
+   load_registry matita_registry;
+   HP.init ()
 
-let make cwd registry =
+let make registry =
    let id x = x in
    let get_coercions = R.get_list (R.pair id id) in 
    let get_output_type key =
@@ -117,8 +123,8 @@ let make cwd registry =
       scripts = Array.make default_scripts default_script
    } in
    let st = {st with
-      heading_path = Filename.concat cwd st.heading_path;
-      output_path = Filename.concat cwd st.output_path;
+      heading_path = Filename.concat !O.cwd st.heading_path;
+      output_path = Filename.concat !O.cwd st.output_path;
    } in
    prerr_endline "reading file names ...";
    let st = set_files st in
@@ -189,13 +195,13 @@ let produce st =
       let in_base_uri = Filename.concat st.input_base_uri name in
       let out_base_uri = Filename.concat st.output_base_uri name in
       let filter path = function
-         | T.Inline (b, k, obj, p)      -> 
+         | T.Inline (b, k, obj, p, f)   -> 
            let obj, p = 
               if b then Filename.concat (make_path path) obj, make_prefix path
               else obj, p
            in 
            let s = obj ^ G.string_of_inline_kind k in
-           path, Some (T.Inline (b, k, Filename.concat in_base_uri s, p))
+           path, Some (T.Inline (b, k, Filename.concat in_base_uri s, p, f))
         | T.Include s                  ->
            begin 
               try path, Some (T.Include (List.assoc s st.requires))