let black = "\e[0m"
let default_callback tag s =
- let prefix =
+ let prefix,ch =
match tag with
- | `Message -> green ^ "Info: "
- | `Warning -> yellow ^ "Warn: "
- | `Error -> red ^ "Error: "
- | `Debug -> blue ^ "Debug: "
+ | `Message -> green ^ "Info: ", stdout
+ | `Warning -> yellow ^ "Warn: ", stderr
+ | `Error -> red ^ "Error: ", stderr
+ | `Debug -> blue ^ "Debug: ", stderr
in
- print_endline (prefix ^ black ^ s);
- flush stdout
+ output_string ch (prefix ^ black ^ s ^ "\n");
+ flush ch
let callback = ref default_callback
(_, TA.Alias (_, TA.Ident_alias(_, uri)))) ->
Hashtbl.add aliases file uri
| TA.Executable (_, TA.Command (_, TA.Include (_, path))) ->
- Hashtbl.add deps file (MatitaMisc.obj_file_of_script (find path))
+ (try
+ Hashtbl.add deps file (MatitaMisc.obj_file_of_script (find path))
+ with
+ Sys_error _ ->
+ MatitaLog.error
+ ("In file " ^ file ^ " unable to include " ^ path)
+ )
| _ -> ()
with
CicNotationParser.Parse_error _ as exn ->