module Errormsg: sig end
Utilities for error reporting.
type parseinfo
val newline : unit -> unit
val parse_error : string -> int -> int -> unit
type parseWhat =
| |
ParseString of string |
| |
ParseFile of string |
val startParsing : parseWhat -> Lexing.lexbuf
val finishParsing : unit -> unit
val setCurrentLine : int -> unit
val setCurrentFile : string -> unit
val currentPattern : string Pervasives.ref
val getPosition : unit -> int * string * int
val push_context : (unit -> unit) Pervasives.ref
val add_type : (string -> unit) Pervasives.ref
val add_identifier : (string -> unit) Pervasives.ref
val pop_context : (unit -> unit) Pervasives.ref
val logChannel : Pervasives.out_channel Pervasives.ref
A channel for printing log messages
val debugFlag : bool Pervasives.ref
If set then print debugging info
val verboseFlag : bool Pervasives.ref
val warnFlag : bool Pervasives.ref
Set to true if you want to see all warnings.
val theLexbuf : Lexing.lexbuf Pervasives.ref
exception Error
Error reporting functions raise this exception
val error : ('a, unit, Pretty.doc) format -> 'a
Prints an error message of the form Error: ...
and then raises the
exception Error
. Use in conjunction with s, for example: E.s (E.error
... )
.
val bug : ('a, unit, Pretty.doc) format -> 'a
Similar to error
except that its output has the form Bug: ...
val unimp : ('a, unit, Pretty.doc) format -> 'a
Similar to error
except that its output has the form Unimplemented: ...
val s : Pretty.doc -> 'a
val hadErrors : bool Pervasives.ref
This is set whenever one of the above error functions are called. It must
be cleared manually
val warn : ('a, unit, Pretty.doc) format -> 'a
val warnOpt : ('a, unit, Pretty.doc) format -> 'a
val log : ('a, unit, Pretty.doc) format -> 'a
Print something to logChannel
val pushContext : (unit -> Pretty.doc) -> unit
Registers a context printing function
val popContext : unit -> unit
Removes the last registered context printing function
val showContext : unit -> unit
Show the context stack to stderr
val withContext : (unit -> Pretty.doc) -> ('a -> 'b) -> 'a -> 'b
To ensure that the context is registered and removed properly, use the
function below