package pp_loc

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Pp_loc.PositionSource

A position in a file or string.

It is abstract to provide more flexibility than Lexing.position.

  • since 2.0
Sourcetype t
Sourceval of_lexing : Lexing.position -> t

Convert position. The filename is ignored, the offset, line, and column are potentially used so they matter.

Sourceval of_offset : int -> t

Build a position from a byte offset in the input.

Sourceval of_line_col : int -> int -> t

of_line_col line col builds the position indicating the character at column col and line line of the input. Lines and columns start at 1.

Sourceval shift : t -> int -> t

shift pos n is the position located n bytes after pos.

OCaml

Innovation. Community. Security.