diff options
author | Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> | 1997-06-16 15:34:13 +0000 |
---|---|---|
committer | Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> | 1997-06-16 15:34:13 +0000 |
commit | 1acf12fe955e4b1ee3d2d5f4ab003fc2de973f45 (patch) | |
tree | 9f61a7083ba903a376ddfa466cff2c17ae5000da | |
parent | 45ffca10099a2508795826433ba1463940fb3aec (diff) |
Ajout exception pour error dans preprocesseur
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1613 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | toplevel/toploop.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml index fc7594d3c..298c989db 100644 --- a/toplevel/toploop.ml +++ b/toplevel/toploop.ml @@ -209,6 +209,7 @@ let _ = (* The loop *) let parse_toplevel_phrase = ref Parse.toplevel_phrase +exception PPerror let loop() = print_string " Objective Caml version "; @@ -228,11 +229,13 @@ let loop() = empty_lexbuf lb; Location.reset(); first_line := true; - execute_phrase (!parse_toplevel_phrase lb); () + let phr = try !parse_toplevel_phrase lb with Exit -> raise PPerror in + execute_phrase phr; () with End_of_file -> exit 0 | Sys.Break -> print_string "Interrupted."; print_newline() + | PPerror -> () | x -> Errors.report_error x done |