X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitacLib.ml;h=c16915e63c9cbeb11c97cf60a457104e746a2446;hb=b05dceab1903f9d15f214a9ddeaf791cd594e215;hp=5f07aa406df52c7007c9f8e3d0f97636d8fd33a1;hpb=ebc063e65d908c9f35619c92454dbbe76bdabd40;p=helm.git diff --git a/helm/matita/matitacLib.ml b/helm/matita/matitacLib.ml index 5f07aa406..c16915e63 100644 --- a/helm/matita/matitacLib.ml +++ b/helm/matita/matitacLib.ml @@ -136,9 +136,9 @@ let main ~mode = let hou = if tm.Unix.tm_hour > 0 then (string_of_int tm.Unix.tm_hour ^ "h ") else "" in - let proof_status = + let proof_status,moo_content_rev = match !status with - | Some s -> !s.proof_status + | Some s -> !s.proof_status, !s.moo_content_rev | None -> assert false in if proof_status <> MatitaTypes.No_proof then @@ -149,13 +149,22 @@ 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; MatitaLog.message (sprintf "execution of %s completed in %s." fname (hou^min^sec)); - close_out (open_out (MatitaMisc.obj_file_of_script fname)); exit 0 end with - | Sys.Break -> MatitaLog.error "user break!"; exit ~-1 + | Sys.Break -> + MatitaLog.error "user break!"; + if mode = `COMPILER then + exit ~-1 + else + pp_ocaml_mode () | MatitaEngine.Drop -> if mode = `COMPILER then exit 1 @@ -168,4 +177,4 @@ let main ~mode = if mode = `COMPILER then exit 1 else - go () + pp_ocaml_mode ()