package electrod

  1. Overview
  2. Docs

Locations in a file (issued from the parsing phase).

type t

A location in a file represents an interval from a start position to an end one.

val from_positions : Stdlib.Lexing.position -> Stdlib.Lexing.position -> t

from_positions begp endp takes Lexing.positions begp and endp position returns a location out of them. Requires: begp < endp.

Accessors:

val begl : t -> int
val begc : t -> int
val endl : t -> int
val endc : t -> int
val to_ints : t -> (int * int) * (int * int)
val span : (t * t) -> t

Merge two positions

val dummy : t

Dummy position

type 'a located = {
  1. data : 'a;
  2. loc : t;
}
val make_located : 'a -> t -> 'a located
val pp_located : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a located -> unit
include Intf.Print.S with type t := t
val pp : t Fmtc.t
val to_string : t -> string
OCaml

Innovation. Community. Security.