Module Loc
Basic types
type source=|InFile of string|ToplevelInputtype t={fname : source;filename or toplevel input
line_nb : int;start line number
bol_pos : int;position of the beginning of start line
line_nb_last : int;end line number
bol_pos_last : int;position of the beginning of end line
bp : int;start position
ep : int;end position
}
Location manipulation
val create : source -> int -> int -> int -> int -> tCreate a location from a filename, a line number, a position of the beginning of the line, a start and end position
val unloc : t -> int * intReturn the start and end position of a location
val make_loc : (int * int) -> tMake a location out of its start and end position
val merge : t -> t -> tval merge_opt : t option -> t option -> t optionMerge locations, usually generating the largest possible span
Located exceptions
val add_loc : Exninfo.info -> t -> Exninfo.infoAdding location to an exception
val get_loc : Exninfo.info -> t optionRetrieving the optional location of an exception
val raise : ?loc:t -> exn -> 'araise loc eis the same asPervasives.raise (add_loc e loc).
Objects with location information
type 'a located= t option * 'a