package ppxlib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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 = Warnings.loc = {
  1. loc_start : Stdlib.Lexing.position;
  2. loc_end : Stdlib.Lexing.position;
  3. loc_ghost : bool;
}
val in_file : 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 init : Stdlib.Lexing.lexbuf -> string -> unit

Set the file name and line number of the lexbuf to be the start of the named file.

val raise_errorf : ?loc:t -> ('a, Ppxlib__.Import.Caml.Format.formatter, unit, 'b) Stdlib.format4 -> 'a

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

val of_lexbuf : Stdlib.Lexing.lexbuf -> t

Return the location corresponding to the last matched regular expression

val report_exception : Ppxlib__.Import.Caml.Format.formatter -> exn -> unit

Report an exception on the given formatter

val print : Ppxlib__.Import.Caml.Format.formatter -> t -> unit

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

type nonrec 'a loc = 'a Location.loc = {
  1. txt : 'a;
  2. loc : t;
}
val compare_pos : Stdlib.Lexing.position -> Stdlib.Lexing.position -> int
val min_pos : Stdlib.Lexing.position -> Stdlib.Lexing.position -> Stdlib.Lexing.position
val max_pos : Stdlib.Lexing.position -> Stdlib.Lexing.position -> Stdlib.Lexing.position
val compare : t -> t -> int
module Error : sig ... end
exception Error of Error.t
OCaml

Innovation. Community. Security.