Module Location.Error

For a detailed explanation on error reporting, refer to the relevant part of the tutorial.

type t
val make : loc:t -> string -> sub:(t * string) list -> t
val createf : loc:t -> ('a, Format.formatter, unit, t) format4 -> 'a
val message : t -> string
val set_message : t -> string -> t
val register_error_of_exn : (exn -> t option) -> unit

Register an exception handler. Exception registered this way will be properly displayed by report_exception.

val of_exn : exn -> t option

Convert an error to an extension point. The compiler recognizes this and displays the error properly.

val raise : t -> 'a

Raise a compiler Parsing.Location.Error exception. The composition of Location.Error.createf with Location.Error.raise is the same as Location.raise_errorf.

val update_loc : t -> t -> t

Update where the error is located. The old location will be overwritten.

val get_location : t -> t

Find out where the error is located.