diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2010-01-22 12:48:24 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2010-01-22 12:48:24 +0000 |
commit | 04b1656222698bd7e92f213e9a718b7a4185643a (patch) | |
tree | 6186d1ba1e00adb1232908f95cb92c299902a943 /toplevel | |
parent | bdc0fadee2dc9669818955486b4c3497016edda5 (diff) |
clean up spaces and tabs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'toplevel')
-rw-r--r-- | toplevel/opttopdirs.ml | 30 | ||||
-rw-r--r-- | toplevel/opttopmain.ml | 1 | ||||
-rw-r--r-- | toplevel/topdirs.ml | 6 | ||||
-rw-r--r-- | toplevel/topmain.ml | 3 | ||||
-rw-r--r-- | toplevel/trace.mli | 2 |
5 files changed, 20 insertions, 22 deletions
diff --git a/toplevel/opttopdirs.ml b/toplevel/opttopdirs.ml index 5c6305226..b586bae1c 100644 --- a/toplevel/opttopdirs.ml +++ b/toplevel/opttopdirs.ml @@ -37,10 +37,10 @@ let dir_directory s = Config.load_path := d :: !Config.load_path let _ = Hashtbl.add directive_table "directory" (Directive_string dir_directory) -let _ = Hashtbl.add directive_table "show_dirs" - (Directive_none +let _ = Hashtbl.add directive_table "show_dirs" + (Directive_none (fun () -> - List.iter print_endline !Config.load_path + List.iter print_endline !Config.load_path )) (* To change the current directory *) @@ -52,7 +52,7 @@ let _ = Hashtbl.add directive_table "cd" (Directive_string dir_cd) (* Load in-core a .cmxs file *) let load_file ppf name0 = - let name = + let name = try Some (find_in_path !Config.load_path name0) with Not_found -> None in match name with @@ -67,23 +67,23 @@ let load_file ppf name0 = else name,false in - let success = + let success = (* The Dynlink interface does not allow us to distinguish between a Dynlink.Error exceptions raised in the loaded modules or a genuine error during dynlink... *) try Dynlink.loadfile fn; true - with + with | Dynlink.Error err -> - fprintf ppf "Error while loading %s: %s.@." - name (Dynlink.error_message err); - false - | exn -> - print_exception_outcome ppf exn; - false + fprintf ppf "Error while loading %s: %s.@." + name (Dynlink.error_message err); + false + | exn -> + print_exception_outcome ppf exn; + false in if tmp then (try Sys.remove fn with Sys_error _ -> ()); success - + let dir_load ppf name = ignore (load_file ppf name) @@ -126,7 +126,7 @@ let find_printer_type ppf lid = with Ctype.Unify _ -> (match_printer_type ppf desc "printer_type_old", true) in (ty_arg, path, is_old_style) - with + with | Not_found -> fprintf ppf "Unbound value %a.@." Printtyp.longident lid; raise Exit @@ -134,7 +134,7 @@ let find_printer_type ppf lid = fprintf ppf "%a has a wrong type for a printing function.@." Printtyp.longident lid; raise Exit - + let dir_install_printer ppf lid = try let (ty_arg, path, is_old_style) = find_printer_type ppf lid in diff --git a/toplevel/opttopmain.ml b/toplevel/opttopmain.ml index 4e08353ec..e2f5e7296 100644 --- a/toplevel/opttopmain.ml +++ b/toplevel/opttopmain.ml @@ -122,4 +122,3 @@ let main () = ]) file_argument usage; if not (prepare Format.err_formatter) then exit 2; Opttoploop.loop Format.std_formatter - diff --git a/toplevel/topdirs.ml b/toplevel/topdirs.ml index 9e542f452..6516a3877 100644 --- a/toplevel/topdirs.ml +++ b/toplevel/topdirs.ml @@ -164,7 +164,7 @@ let find_printer_type ppf lid = with Ctype.Unify _ -> (match_printer_type ppf desc "printer_type_old", true) in (ty_arg, path, is_old_style) - with + with | Not_found -> fprintf ppf "Unbound value %a.@." Printtyp.longident lid; raise Exit @@ -172,7 +172,7 @@ let find_printer_type ppf lid = fprintf ppf "%a has a wrong type for a printing function.@." Printtyp.longident lid; raise Exit - + let dir_install_printer ppf lid = try let (ty_arg, path, is_old_style) = find_printer_type ppf lid in @@ -230,7 +230,7 @@ let dir_trace ppf lid = | None -> (* Instrument the old closure *) traced_functions := - { path = path; + { path = path; closure = clos; actual_code = get_code_pointer clos; instrumented_fun = diff --git a/toplevel/topmain.ml b/toplevel/topmain.ml index fc105567a..265a70a38 100644 --- a/toplevel/topmain.ml +++ b/toplevel/topmain.ml @@ -21,7 +21,7 @@ let preload_objects = ref [] let prepare ppf = Toploop.set_paths (); try - let res = + let res = List.for_all (Topdirs.load_file ppf) (List.rev !preload_objects) in !Toploop.toplevel_startup_hook (); res @@ -101,4 +101,3 @@ let main () = ] file_argument usage; if not (prepare Format.err_formatter) then exit 2; Toploop.loop Format.std_formatter - diff --git a/toplevel/trace.mli b/toplevel/trace.mli index ed7dc6e33..d708361c7 100644 --- a/toplevel/trace.mli +++ b/toplevel/trace.mli @@ -30,6 +30,6 @@ val is_traced: Obj.t -> Path.t option val get_code_pointer: Obj.t -> codeptr val set_code_pointer: Obj.t -> codeptr -> unit val instrument_closure: - Env.t -> Longident.t -> formatter -> Types.type_expr -> + Env.t -> Longident.t -> formatter -> Types.type_expr -> codeptr -> Obj.t -> Obj.t -> Obj.t val print_trace: Obj.t -> Obj.t -> Obj.t |