1 (** This module provides a uniform way of reporting (located) error message. *)
3 (** [exit_if_error ()] forces the program to stop if an error is encountered.
4 (This is the default behavior.) *)
5 val exit_if_error: unit -> unit
7 (** [resume_if_error ()] makes the program throw the exception {!Error}
8 if an error is encountered. *)
9 val resume_if_error: unit -> unit
11 exception Error of Position.t list * string
13 (** [print_error positions msg] formats an error message. *)
14 val print_error : Position.t list -> string -> string
16 (** [error k p msg] prints [msg] with [k] as a message prefix and stops
18 val error : string -> Position.t -> string -> 'a
20 (** [error2 k p1 p2 msg] prints two positions instead of one. *)
21 val error2 : string -> Position.t -> Position.t -> string -> 'a
23 (** [global_error k msg] prints [msg] with [k] as a message prefix and stops
25 val global_error : string -> string -> 'a
27 (** [warning k msg] prints [msg] with [k] as a message prefix, but do
28 not stop the program. *)
29 val warning : string -> string -> unit