package combinaml

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

Module Combinaml.InputSource

Sourcetype t = {
  1. s : string;
  2. pos : int;
}
Sourceval init : string -> t
Sourceexception End_of_input
Sourceval show : t -> string
Sourceval length : t -> int

length i return remaining length (String.length i.s - i.pos).

Sourceval is_at_end : t -> bool
Sourceval has_length : t -> int -> bool
Sourceval incr_by_unsafe : int -> t -> t
Sourceval incr_unsafe : t -> t
Sourceval incr_by : int -> t -> t
Sourceval sub_unsafe : t -> int -> string

sub_unsafe i len return sub string of i.s from i.pos..i.pos + len.

Sourceval rest_unsafe : t -> string

rest_unsafe i returns the rest of the input from i.pos.

Sourceval rest : t -> string
Sourceval rest_of_len_unsafe : int -> t -> string

rest_of_len_unsafe len i returns the rest of the input from i.pos .. i.pos + len.

Sourceval rest_of_len : int -> t -> string
Sourceval get_unsafe : int -> t -> char

get_unsafe pos i returns the character at position i.pos + pos.

Sourceval get : int -> t -> char
Sourceval first_unsafe : t -> char

first_unsafe i returns the character at position i.pos.

Sourceval first : t -> char
Sourceval take_while_fn : t -> ?max:int -> (char -> bool) -> int

take_while_fn i max f returns a sub string from i.pos to the first character where f c fails.

Sourceval starts_with : t -> string -> bool

starts_with i s returns true if input starts with s. does not create any temporary strings by using String.sub.