From: Claudio Sacerdoti Coen Date: Tue, 19 Jul 2005 13:10:06 +0000 (+0000) Subject: Ctrl^D in matitatop fixed (was broken by the new parser of Zack and Luca) X-Git-Tag: V_0_7_2~170 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=f13efc1fff944ff0d3bd1414eae1739fead31856;p=helm.git Ctrl^D in matitatop fixed (was broken by the new parser of Zack and Luca) --- diff --git a/helm/matita/matitacLib.ml b/helm/matita/matitacLib.ml index 076be5416..c77bb76bd 100644 --- a/helm/matita/matitacLib.ml +++ b/helm/matita/matitacLib.ml @@ -73,6 +73,7 @@ let run_script is eval_function = eval_function status is cb with | MatitaEngine.Drop + | End_of_file | CicNotationParser.Parse_error _ as exn -> raise exn | exn -> MatitaLog.error (MatitaExcPp.to_string exn); @@ -119,17 +120,13 @@ let rec interactive_loop () = | MatitaEngine.Drop -> pp_ocaml_mode () | Sys.Break -> MatitaLog.error "user break!"; interactive_loop () | MatitaTypes.Command_error _ -> interactive_loop () + | End_of_file -> + print_newline (); + clean_exit (Some 0) | CicNotationParser.Parse_error (floc,err) -> - (* check for EOI *) - if Stream.peek str = None then - begin - print_newline (); - clean_exit (Some 0) - end - else - let (x, y) = CicNotationPt.loc_of_floc floc in - MatitaLog.error (sprintf "Parse error at %d-%d: %s" x y err); - interactive_loop () + let (x, y) = CicNotationPt.loc_of_floc floc in + MatitaLog.error (sprintf "Parse error at %d-%d: %s" x y err); + interactive_loop () | exn -> MatitaLog.error (Printexc.to_string exn); interactive_loop () let go () =