Source code locations (ranges of positions), used in parsetree.
Note on the use of Lexing.position in this module.
If pos_fname = "", then use !input_name instead.
If pos_lnum = -1, then pos_bol = 0. Use pos_cnum and
re-parse the file to get the line and character numbers.
Else all fields are correct.
val init : Stdlib.Lexing.lexbuf -> string -> unitSet the file name and line number of the lexbuf to be the start
of the named file.
val symbol_rloc : unit -> tval symbol_gloc : unit -> tval rhs_loc : int -> trhs_loc n returns the location of the symbol at position n, starting
at 1, in the current parser rule.
val input_name : string Stdlib.refval input_lexbuf : Stdlib.Lexing.lexbuf option Stdlib.refval get_pos_info : Stdlib.Lexing.position -> string * int * intval print_loc : Stdlib.Format.formatter -> t -> unitval print_error : Stdlib.Format.formatter -> t -> unitval print_error_cur_file : Stdlib.Format.formatter -> unit -> unitval print_warning : t -> Stdlib.Format.formatter -> Warnings.t -> unitval formatter_for_warnings : Stdlib.Format.formatter Stdlib.refval prerr_warning : t -> Warnings.t -> unitval default_printer : Stdlib.Format.formatter -> t -> unitval printer : (Stdlib.Format.formatter -> t -> unit) Stdlib.refval warning_printer : (t -> Stdlib.Format.formatter -> Warnings.t -> unit) Stdlib.refHook for intercepting warnings.
val default_warning_printer : t -> Stdlib.Format.formatter -> Warnings.t -> unitOriginal warning printer for use in hooks.
val highlight_locations : Stdlib.Format.formatter -> t list -> boolval mknoloc : 'a -> 'a locval print : Stdlib.Format.formatter -> t -> unitval print_compact : Stdlib.Format.formatter -> t -> unitval print_filename : Stdlib.Format.formatter -> string -> unitval show_filename : string -> stringIn -absname mode, return the absolute path for this filename. Otherwise, returns the filename unchanged.
val absname : bool Stdlib.refSupport for located errors
exception Error of errorval errorf : ?loc:t -> ?sub:error list -> ?if_highlight:string -> ('a, Stdlib.Format.formatter, unit, error) Stdlib.format4 -> 'aval raise_errorf : ?loc:t -> ?sub:error list -> ?if_highlight:string -> ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'aval error_of_printer : t -> (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> errorval error_of_printer_file : (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> errorval error_of_exn : exn -> [ `Ok of error | `Already_displayed ] optionval register_error_of_exn : (exn -> error option) -> unitEach compiler module which defines a custom type of exception
which can surface as a user-visible error should register
a "printer" for this exception using register_error_of_exn.
The result of the printer is an error value containing
a location, a message, and optionally sub-messages (each of them
being located as well).
val report_error : Stdlib.Format.formatter -> error -> unitval error_reporter : (Stdlib.Format.formatter -> error -> unit) Stdlib.refHook for intercepting error reports.
val default_error_reporter : Stdlib.Format.formatter -> error -> unitOriginal error reporter for use in hooks.
val report_exception : Stdlib.Format.formatter -> exn -> unitReraise the exception if it is unknown.