]> matita.cs.unibo.it Git - helm.git/commitdiff
function to domp moo_content is now exported
authorEnrico Tassi <enrico.tassi@inria.fr>
Tue, 5 Jul 2005 14:49:51 +0000 (14:49 +0000)
committerEnrico Tassi <enrico.tassi@inria.fr>
Tue, 5 Jul 2005 14:49:51 +0000 (14:49 +0000)
helm/matita/matitacLib.ml
helm/matita/matitacLib.mli

index d4bd0aafe1eef14358c33ca2bdc854a8a7ec4b8d..ba2085bca7cccbaaea8c78e07df04fecbf08e5e5 100644 (file)
@@ -115,6 +115,21 @@ let go () =
   Sys.catch_break true;
   interactive_loop ()
 
+let clean_exit n =
+ match !status with
+    None -> exit n
+  | Some status ->
+     let baseuri = MatitaTypes.get_string_option !status "baseuri" in
+      MatitacleanLib.clean_baseuris ~verbose:false [baseuri];
+      exit n
+  
+let dump_moo_to_file file moo =
+ let os = open_out (MatitaMisc.obj_file_of_script file) in
+ let output s = output_string os s in
+ output "(* GENERATED FILE: DO NOT EDIT! *)\n\n";
+ List.iter output (List.rev moo);
+ close_out os
+  
 let main ~mode = 
   Helm_registry.load_from "matita.conf.xml";
   Http_getter.init ();
@@ -156,11 +171,7 @@ let main ~mode =
      end
     else
      begin
-       let os = open_out (MatitaMisc.obj_file_of_script fname) in
-       let output s = output_string os s in
-       output "(* GENERATED FILE: DO NOT EDIT! *)\n\n";
-       List.iter output (List.rev moo_content_rev);
-       close_out os;
+       dump_moo_to_file fname moo_content_rev;
        MatitaLog.message 
          (sprintf "execution of %s completed in %s." fname (hou^min^sec));
        exit 0
index 8032320ce7103b487da2e048155ef9e631629d31..a053a3f1a1318dd0ab667877cbaf8df50b9a0e14 100644 (file)
@@ -28,6 +28,7 @@ val interactive_loop : unit -> unit
 (** go initializes the status and calls interactive_loop *)
 val go : unit -> unit
 val main : mode:[ `COMPILER | `TOPLEVEL ] -> unit
+val dump_moo_to_file: string -> string list -> unit
 
 (** clean_exit n
   performs an exit [n] after a complete clean-up of what was partially compiled