package frenetic

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

A custom lexbuffer that automatically keeps track of the source location. This module is a thin wrapper arounds sedlexing's default buffer, which does not provide this functionality.

type t = {
  1. buf : Sedlexing.lexbuf;
  2. mutable pos : Lexing.position;
  3. mutable pos_mark : Lexing.position;
  4. mutable last_char : Core.Uchar.t option;
  5. mutable last_char_mark : Core.Uchar.t option;
}

the lex buffer type

val of_sedlex : ?file:string -> ?pos:Lexing.position -> Sedlexing.lexbuf -> t
val of_ascii_string : ?pos:Lexing.position -> string -> t
val of_ascii_file : Base.string -> t
val mark : t -> int -> unit

The next four functions are used by sedlex internally. See https://www.lexifi.com/sedlex/libdoc/Sedlexing.html.

val backtrack : t -> int
val start : t -> unit
val next_loc : t -> Lexing.position

location of next character

val cr : Core.Uchar.t
val next : t -> Uchar.t option

next character

val __private__next_int : t -> int
val raw : t -> int array
val ascii : ?skip:int -> ?drop:int -> t -> string