let ic = open_in urifname
+exception Done;;
+
let _ =
try
while true do
let uri,res,time =
match Str.split (Str.regexp " ") uri with
uri::res::time::_ -> uri, Some res, Some (float_of_string time)
+ | [uri;res] -> uri, Some res, None
| [ uri ] -> uri, None, None
| _ -> assert false
in
Printf.printf "%s " uri;
+ flush stdout;
let uri = UriManager.uri_of_string uri in
let before = Unix.gettimeofday () in
ignore (CicTypeChecker.typecheck uri);
with
| End_of_file as exn -> raise exn
| Sys.Break ->
- Printf.printf "\e[0;31mSKIPPED\e[0m\n";
- flush stdout;
- Printf.eprintf "\e[0;31mContinue with next URI? [y/_]\e[0m";
- flush stderr;
- (match input_line stdin with
- "y" -> ()
- | _ -> raise Sys.Break)
+ let rec skip_break prompt =
+ try
+ if prompt then
+ begin
+ Printf.printf "\e[0;31mSKIPPED\e[0m\n";
+ flush stdout;
+ Printf.eprintf "\e[0;31mContinue with next URI? [y/_]\e[0m";
+ flush stderr;
+ end;
+ (match input_line stdin with
+ "y" -> ()
+ | _ -> raise Done)
+ with
+ Sys.Break -> skip_break false
+ in
+ skip_break true
| exn ->
Printf.printf "\e[0;31mFAIL\e[0m\n";
flush stdout;
done
with
End_of_file
- | Sys.Break -> ()
+ | Done -> ()