package ocp-indent-nlfork

  1. Overview
  2. Docs

Lexer regions

type t

A region in a lexer stream

val create : Position.t -> Position.t -> t

Create a region from a starting and an ending position

val fst : t -> Position.t
val snd : t -> Position.t
val start_column : t -> int

Return the column where the region starts

val end_column : t -> int

Return the column where the region ends

val char_offset : t -> int

Get the region offset (number of characters from the beginning of the file

val length : t -> int

Get the lenght of a region

val start_line : t -> int

Return the line number where the region starts

val end_line : t -> int

Return the line number where the region ends

val zero : t

The empty region

val translate : t -> int -> t

translate t x shifts a region by x characters

OCaml

Innovation. Community. Security.