summaryrefslogtreecommitdiff
path: root/toplevel/toploop.mli
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-07-03 14:32:35 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-07-03 14:32:35 +0000
commit1c31feddb59896cdfe242260b0053d97305fabaf (patch)
tree563d6d7b34f34da17228e696958bf400ddf85d29 /toplevel/toploop.mli
parent6d9701f6ce6ecf4774078b6bc9c5b0b6991f9aca (diff)
downloadocaml-1c31feddb59896cdfe242260b0053d97305fabaf.tar.gz
Ajout de .ocamlinit et des scripts
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1639 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'toplevel/toploop.mli')
-rw-r--r--toplevel/toploop.mli28
1 files changed, 23 insertions, 5 deletions
diff --git a/toplevel/toploop.mli b/toplevel/toploop.mli
index 09bae13283..6a7cada139 100644
--- a/toplevel/toploop.mli
+++ b/toplevel/toploop.mli
@@ -15,6 +15,10 @@
val loop: unit -> unit
+(* Read and execute a script from the given file *)
+
+val run_script: string -> bool (* true if successful, false if error *)
+
(* Interface with toplevel directives *)
type directive_fun =
@@ -25,11 +29,25 @@ type directive_fun =
val directive_table: (string, directive_fun) Hashtbl.t
(* Table of known directives, with their execution function *)
-val execute_phrase: Parsetree.toplevel_phrase -> bool
- (* Execute the given toplevel phrase. Return [true] if the
- phrase executed with no errors and [false] otherwise. *)
-val print_exception_outcome: exn -> unit
- (* Print an exception resulting from the evaluation of user code. *)
val toplevel_env: Env.t ref
(* Typing environment for the toplevel *)
+val print_exception_outcome: exn -> unit
+ (* Print an exception resulting from the evaluation of user code. *)
+val execute_phrase: bool -> Parsetree.toplevel_phrase -> bool
+ (* Execute the given toplevel phrase. Return [true] if the
+ phrase executed with no errors and [false] otherwise.
+ First bool says whether the values and types of the results
+ should be printed. Uncaught exceptions are always printed. *)
+val use_file: string -> bool
+val use_silently: string -> bool
+ (* Read and execute commands from a file.
+ [use_file] prints the types and values of the results.
+ [use_silently] does not print them. *)
+
+(* Hooks for an external parser *)
+
val parse_toplevel_phrase : (Lexing.lexbuf -> Parsetree.toplevel_phrase) ref
+val parse_use_file : (Lexing.lexbuf -> Parsetree.toplevel_phrase list) ref
+val print_location : Location.t -> unit
+val print_warning : Location.t -> string -> unit
+val input_name : string ref