raise (FailureCompiling (baseuri,exn))
;;
+let cut prefix s =
+ let lenp = String.length prefix in
+ let lens = String.length s in
+ assert (lens > lenp);
+ assert (String.sub s 0 lenp = prefix);
+ String.sub s lenp (lens-lenp)
+;;
+
+let print_string =
+ let indent = ref 0 in
+ let print_string s = print_string (String.make !indent ' ' ^ s) in
+ fun enter s ->
+ if enter then (print_string s; incr indent) else (decr indent; print_string s)
+;;
-let pp_times fname rc big_bang big_bang_u big_bang_s =
+let pp_times ss fname rc big_bang big_bang_u big_bang_s =
if not (Helm_registry.get_bool "matita.verbose") then
let { Unix.tms_utime = u ; Unix.tms_stime = s} = Unix.times () in
let r = Unix.gettimeofday () -. big_bang in
in
Printf.sprintf "%s %s %s" (fmt r) (fmt u) (fmt s)
in
- let s = Printf.sprintf "%-4s %s %s" rc times extra in
- print_endline s;
+ let s = Printf.sprintf "%-4s %s %s\n" rc times extra in
+ print_string false (ss ^ s);
flush stdout;
HLog.message ("Compilation of "^Filename.basename fname^": "^rc)
;;
-let cut prefix s =
- let lenp = String.length prefix in
- let lens = String.length s in
- assert (lens > lenp);
- assert (String.sub s 0 lenp = prefix);
- String.sub s lenp (lens-lenp)
-;;
-
let activate_extraction baseuri fname =
()
(* MATITA 1.0
Unix.times ()
in
let time = Unix.time () in
+ let cc =
+ let rex = Str.regexp ".*opt$" in
+ if Str.string_match rex Sys.argv.(0) 0 then "matitac.opt"
+ else "matitac" in
+ let s = Printf.sprintf "%s %-35s " cc (cut (root^"/") fname) in
try
(* cleanup of previously compiled objects *)
if (not (Http_getter_storage.is_empty ~local:true baseuri))
end;
HLog.message ("compiling " ^ Filename.basename fname ^ " in " ^ baseuri);
if not (Helm_registry.get_bool "matita.verbose") then
- (let cc =
- let rex = Str.regexp ".*opt$" in
- if Str.string_match rex Sys.argv.(0) 0 then "matitac.opt"
- else "matitac"
- in
- let s = Printf.sprintf "%s %-35s " cc (cut (root^"/") fname) in
- print_string s; flush stdout);
+ (print_string true (s ^ "\n"); flush stdout);
(* we dalay this error check until we print 'matitac file ' *)
assert (Http_getter_storage.is_empty ~local:true baseuri);
(* create dir for XML files *)
in
HLog.message
(sprintf "execution of %s completed in %s." fname (hou^min^sec));
- pp_times fname true big_bang big_bang_u big_bang_s;
+ pp_times s fname true big_bang big_bang_u big_bang_s;
asserted
(* MATITA 1.0: debbo fare time_travel sulla ng_library?
LexiconSync.time_travel
(* MATITA 1.0: debbo fare time_travel sulla ng_library?
LexiconSync.time_travel ~present:lexicon ~past:initial_lexicon_status;
* *)
- pp_times fname false big_bang big_bang_u big_bang_s;
+ pp_times s fname false big_bang big_bang_u big_bang_s;
clean_exit baseuri exn
and assert_ng ~already_included ~compiling ~asserted ~include_paths mapath =