Dolmen_std.LocStandard implementation of file locations.
type loc = private {file : string;start_line : int;start_column : int;start_line_offset : int;stop_line : int;stop_column : int;stop_line_offset : int;max_line_length : int;}A full location, including file, start position and end position. Dummy positions (i.e. with start_line = stop_line and start_column = stop_column) are allowed to represent unknown locations.
module type S = Dolmen_intf.Location.SAn anstract module type for providing locations. Used as argumentby much of the functors provided in Dolmen.
This module implements the signature S.
include S with type t := t and type file := fileexception Uncaught of t * exn * Printexc.raw_backtraceThe exception to be raised whenever an unexpected exception is raised during parsing.
exception Lexing_error of t * stringThe exception to be raised when the lexer cannot parse the input.
exception Syntax_error of t
* [ `Regular of Dolmen_intf.Msg.t
| `Advanced of
string * Dolmen_intf.Msg.t * Dolmen_intf.Msg.t * Dolmen_intf.Msg.t ]Syntax_error (loc, msg) denotes a syntax error at the given location. In the `Advanced (error_ref, prod, parsed, expected) case,
val of_lexbuf : Lexing.lexbuf -> tMake a position using a lexbuf directly.
val mk_pos : Lexing.position -> Lexing.position -> tMake a position from two lewing positions.
val newline : file -> Lexing.lexbuf -> unitOffer a way for the file meta-data to store the current location of the lexbuf as the start of a new line.
val update_size : file -> Lexing.lexbuf -> unitUpdate the file meta-data to store the maximum offset currently seen for this file.
val hash : t -> intHashing function.
val no_loc : tA dummy location pointing at the first byte of a file.
val dummy : locA dummy location pointing at the first byte of a file.
val is_dummy : loc -> boolIs the location an actual location, or a dummy one ?
val mk_file : string -> fileCreate a new set of meta-data for the given filename.
val new_line : file -> int -> unitRegister a new line whose first char is at the given offset.
val lexing_positions : loc -> Lexing.position * Lexing.positionReturn the pair of lexing positions corresponding to a location.
val fmt : Format.formatter -> loc -> unitval fmt_pos : Format.formatter -> loc -> unitval fmt_hint : Format.formatter -> loc -> unitval fmt_compact : Format.formatter -> loc -> unitPrinting functions
val print_compact : Format.formatter -> t -> unitmisc
val file_name : file -> stringFilename for a file