package fmlib

  1. Overview
  2. Docs

Module Fmlib_parse.PositionSource

Represent a position in a text file.

Sourcetype t

Position in a text file.

Sourcetype range = t * t
Sourceval start : t

Position with points to the start of a textfile.

Sourceval line : t -> int

line pos The line number corresponding to the position p. Note: The first line is line 0.

Sourceval column : t -> int

column pos The column number corresponding to the position p. Note: The first column is column 0.

Sourceval next : char -> t -> t

next next_char pos: Advance the position by using the next character. If the next character is a newline, then the line number is increment and the column number is reset to 0.

Sourceval next_line : t -> t

next_line pos Advance the position to the start of the next line.

Sourceval next_column : t -> t

next_column pos Advance the column position by 1.

OCaml

Innovation. Community. Security.