pervasives: grouper les 3 arguments de Assert_failure, ca permet une

meilleure propagation des constantes.
pervasives.mli: documentation de Stack_overflow
printexc.ml: affichage de Stack_overflow.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1997-05-15 13:28:08 +00:00
parent 58d10b597a
commit 1f808f4492
3 changed files with 9 additions and 3 deletions

View File

@ -21,7 +21,7 @@ let failwith s = raise(Failure s)
let invalid_arg s = raise(Invalid_argument s)
exception Exit
exception Assert_failure of string * int * int
exception Assert_failure of (string * int * int)
(* Comparisons *)

View File

@ -53,12 +53,12 @@ type 'a option = None | Some of 'a
external raise : exn -> 'a = "%raise"
(* Raise the given exception value *)
(*- exception Match_failure of string * int * int *)
(*- exception Match_failure of (string * int * int) *)
(* Exception raised when none of the cases of a pattern-matching
apply. The arguments are the location of the pattern-matching
in the source code (file name, position of first character,
position of last character). *)
exception Assert_failure of string * int * int
exception Assert_failure of (string * int * int)
(* Exception raised when an assertion fails. The arguments are
the location of the pattern-matching in the source code
(file name, position of first character, position of last
@ -75,6 +75,10 @@ exception Assert_failure of string * int * int
(*- exception Out_of_memory *)
(* Exception raised by the garbage collector
when there is insufficient memory to complete the computation. *)
(*- exception Stack_overflow *)
(* Exception raised by the bytecode interpreter when the evaluation
stack reaches its maximal size. This often indicates infinite
or excessively deep recursion in the user's program. *)
(*- exception Sys_error of string *)
(* Exception raised by the input/output functions to report
an operating system error. *)

View File

@ -21,6 +21,8 @@ let prerr_loc file first_char last_char msg =
let print_exn = function
Out_of_memory ->
prerr_string "Out of memory\n"
| Stack_overflow ->
prerr_string "Stack overflow\n"
| Match_failure(file, first_char, last_char) ->
prerr_loc file first_char last_char "Pattern matching failed";
| Assert_failure(file, first_char, last_char) ->