Ajout de toplevel_startup_hook (pour Cash)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5636 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2003-06-30 15:31:06 +00:00
parent de53ed7fb7
commit e8e8d33624
3 changed files with 13 additions and 1 deletions

View File

@ -104,6 +104,10 @@ let print_location = Location.print
let print_warning = Location.print_warning let print_warning = Location.print_warning
let input_name = Location.input_name let input_name = Location.input_name
(* Hooks for initialization *)
let toplevel_startup_hook = ref (fun () -> ())
(* Load in-core and execute a lambda term *) (* Load in-core and execute a lambda term *)
let may_trace = ref false (* Global lock on tracing *) let may_trace = ref false (* Global lock on tracing *)

View File

@ -98,6 +98,10 @@ val print_out_signature :
val print_out_phrase : val print_out_phrase :
(formatter -> Outcometree.out_phrase -> unit) ref (formatter -> Outcometree.out_phrase -> unit) ref
(* Hooks for initialization *)
val toplevel_startup_hook : (unit -> unit) ref
(* Used by Trace module *) (* Used by Trace module *)
val may_trace : bool ref val may_trace : bool ref

View File

@ -20,7 +20,11 @@ let preload_objects = ref []
let prepare ppf = let prepare ppf =
Toploop.set_paths (); Toploop.set_paths ();
try List.for_all (Topdirs.load_file ppf) (List.rev !preload_objects) try
let res =
List.for_all (Topdirs.load_file ppf) (List.rev !preload_objects) in
!Toploop.toplevel_startup_hook ();
res
with x -> with x ->
try Errors.report_error ppf x; false try Errors.report_error ppf x; false
with x -> with x ->