(**************************************************************************) (* *) (* OCaml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright 1996 Institut National de Recherche en Informatique et *) (* en Automatique. *) (* *) (* All rights reserved. This file is distributed under the terms of *) (* the GNU Lesser General Public License version 2.1, with the *) (* special exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) (** Source code locations (ranges of positions), used in parsetree. Reporting errors and warnings at a location is in {!Loc_report}. *) type t = {loc_start: Lexing.position; loc_end: Lexing.position; loc_ghost: bool} (** Note on the use of Lexing.position in this module. If [pos_fname = ""], then use [Loc_report.get_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 none : t (** An arbitrary value of type [t]; describes an empty ghost range. *) val in_file : string -> t (** Return an empty ghost range located in a given file. *) val get_pos_info : Lexing.position -> string * int * int (* file, line, char *) type 'a loc = {txt: 'a; loc: t} val mknoloc : 'a -> 'a loc val mkloc : 'a -> t -> 'a loc val map_loc : ('a -> 'b) -> 'a loc -> 'b loc