package ostap

  1. Overview
  2. Docs

Text coordinate.

type t = int * int

Type synonym: line, column.

val line : t -> int

Gets line of coordinate.

val col : t -> int

Gets column of coordinate.

val toString : t -> string

String conversion.

val next : bool -> t -> t

next isNewLine loc gets next coord depending on the current symbol

val shift : t -> string -> int -> int -> t

shift loc s b e takes text coordinates loc, string s and two indexes b and e, scans s from b to e inclusively and shifts loc to take newlines into account.

val compare : t -> t -> int

Comparison function.

OCaml

Innovation. Community. Security.