Module Ppx_core.Location

Overrides the Location module of OCaml

There are less functions in this module. However the API should be more stable than the Location module of OCaml.

type t = Ppx_core__.Import.location = {
loc_start : Lexing.position;
loc_end : Lexing.position;
loc_ghost : Ppx_core__.Import.bool;
}
val in_file : Ppx_core__.Import.string ‑> t

Return an empty ghost range located in a given file.

val none : t

An arbitrary value of type t; describes an empty ghost range.

val raise_errorf : ?⁠loc:t ‑> ('aCaml.Format.formatter, Ppx_core__.Import.unit'bPpx_core__.Import.format4 ‑> 'a

Raise a located error. The exception is caught by ppx_driver and handled appropriately

val of_lexbuf : Lexing.lexbuf ‑> t

Return the location corresponding to the last matched regular expression

val report_exception : Caml.Format.formatter ‑> Ppx_core__.Import.exn ‑> Ppx_core__.Import.unit

Report an exception on the given formatter

val print : Caml.Format.formatter ‑> t ‑> Ppx_core__.Import.unit

Prints File "...", line ..., characters ...-...:

type 'a loc = 'a Ppx_core__.Import.loc = {
txt : 'a;
loc : t;
}
module Error : sig ... end with type location := t
exception Error of Error.t