summaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>1998-11-12 14:53:46 +0000
committerPierre Weis <Pierre.Weis@inria.fr>1998-11-12 14:53:46 +0000
commit4508b801009175c5668a61c8c986b151baee64af (patch)
tree7dd480c3386ae35ba0ace2d4cad8b62a74c64852 /toplevel
parent208727b833b320fd1dc8853d7f4d9a5462f1d709 (diff)
downloadocaml-4508b801009175c5668a61c8c986b151baee64af.tar.gz
Éviction des alertes des séquences: ajout de fonctions rendant unit ou
de prédicats dans le cas où l'on appelait une fonction pour savoir si ça pouvait marcher en capturant une exception. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2172 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/topdirs.ml4
-rw-r--r--toplevel/toploop.ml10
2 files changed, 9 insertions, 5 deletions
diff --git a/toplevel/topdirs.ml b/toplevel/topdirs.ml
index 4aa05e34cc..57ea804302 100644
--- a/toplevel/topdirs.ml
+++ b/toplevel/topdirs.ml
@@ -68,7 +68,7 @@ let load_compunit ic filename compunit =
Symtable.patch_object code compunit.cu_reloc;
Symtable.update_global_table();
begin try
- (Meta.reify_bytecode code code_size) (); ()
+ let _ = (Meta.reify_bytecode code code_size) () in ()
with exn ->
Symtable.restore_state initial_symtable;
print_exception_outcome exn;
@@ -106,7 +106,7 @@ let _ = Hashtbl.add directive_table "load" (Directive_string dir_load)
(* Load commands from a file *)
-let dir_use name = Toploop.use_file name; ()
+let dir_use name = let _ = Toploop.use_file name in ()
let _ = Hashtbl.add directive_table "use" (Directive_string dir_use)
diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml
index 0453ca7fb4..e5619012a3 100644
--- a/toplevel/toploop.ml
+++ b/toplevel/toploop.ml
@@ -208,7 +208,7 @@ let use_file name =
(* Skip initial #! line if any *)
let buffer = String.create 2 in
if input ic buffer 0 2 = 2 && buffer = "#!"
- then begin input_line ic; () end
+ then let _ = input_line ic in ()
else seek_in ic 0;
let success =
protect Location.input_name filename (fun () ->
@@ -271,6 +271,10 @@ let _ =
Clflags.thread_safe := true;
Compile.init_path()
+let load_ocamlinit () =
+ if Sys.file_exists ".ocamlinit" then let _ = use_silently ".ocamlinit" in ()
+
+
(* The interactive loop *)
exception PPerror
@@ -288,14 +292,14 @@ let loop() =
Location.input_name := "";
Location.input_lexbuf := Some lb;
Sys.catch_break true;
- if Sys.file_exists ".ocamlinit" then begin use_silently ".ocamlinit"; () end;
+ load_ocamlinit ();
while true do
try
empty_lexbuf lb;
Location.reset();
first_line := true;
let phr = try !parse_toplevel_phrase lb with Exit -> raise PPerror in
- execute_phrase true phr; ()
+ let _ = execute_phrase true phr in ()
with
End_of_file -> exit 0
| Sys.Break ->