Source

ocaml-indent / pos.mli

Full commit
module Position : sig
  type t = Lexing.position = {
    pos_fname : string;
    pos_lnum : int;
    pos_bol : int;
    pos_cnum : int;
  } with sexp

  val to_string : t -> string
  val zero : t
  val columns : t -> int
  val compare : t -> t -> int
  val compare_lines_cols : t -> int * int -> int
end

module Region : sig
  type t = Position.t * Position.t with sexp
  
  val lnum : Position.t * 'a -> int
  val columns : Position.t * 'a -> int
  val zero : t
  val move_chars : int -> t -> t
  val contains : t -> Position.t -> [> `In | `Out_left | `Out_right ]
  val contains_lines_cols : t -> int * int -> [> `In | `Out_left | `Out_right ]
end