package inquire

  1. Overview
  2. Docs
An OCaml library to create beautiful interactive CLIs

Install

Dune Dependency

Authors

Maintainers

Sources

inquire-0.2.1.tbz
sha256=0b88d89e24d4cbc0560a7c8d8ec51388990e1b27f24685029997afa52a7c720f
sha512=8b62860a8d15e41528a404a6f1b9968c3d79755607b5ea319af2e3e45516e672a785361d278279910928db4054e1800e87bcee0210ff3eabfb330713b368c827

doc/inquire.zed/Zed_rope/Zip/index.html

Module Zed_rope.ZipSource

Sourcetype t

Type of zippers. A zipper allow to naviguate in a rope in a convenient and efficient manner. Note that a zipper points to a position between two glyphs, not to a glyph, so in a rope of length len there is len + 1 positions.

Sourceval make_f : rope -> int -> t

make_f rope pos creates a new zipper pointing to positon pos of rope.

Sourceval make_b : rope -> int -> t

make_b rope pos creates a new zipper pointing to positon length rope - pos of rope.

Sourceval offset : t -> int

Returns the position of the zipper in the rope.

Sourceval next : t -> Zed_char.t * t

next zipper returns the glyph at the right of the zipper and a zipper to the next position. It raises Out_of_bounds if the zipper points to the end of the rope.

Sourceval prev : t -> Zed_char.t * t

prev zipper returns the glyph at the left of the zipper and a zipper to the previous position. It raises Out_of_bounds if the zipper points to the beginning of the rope.

Sourceval move : int -> t -> t

move n zip moves the zipper by n glyphs. If n is negative it is moved to the left and if it is positive it is moved to the right. It raises Out_of_bounds if the result is outside the bounds of the rope.

Sourceval at_bos : t -> bool

at_bos zipper returns true if zipper points to the beginning of the rope.

Sourceval at_eos : t -> bool

at_eos zipper returns true if zipper points to the end of the rope.

Sourceval find_f : (Zed_char.t -> bool) -> t -> t

find_f f zip search forward for a glyph to satisfy f. It returns a zipper pointing to the left of the first glyph to satisfy f, or a zipper pointing to the end of the rope if no such glyph exists.

Sourceval find_b : (Zed_char.t -> bool) -> t -> t

find_b f zip search backward for a glyph to satisfy f. It returns a zipper pointing to the right of the first glyph to satisfy f, or a zipper pointing to the beginning of the rope if no such glyph exists.

Sourceval sub : t -> int -> rope

sub zipper len returns the sub-rope of length len pointed by zipper.

Sourceval slice : t -> t -> rope

slice zipper1 zipper2 returns the rope between zipper1 and zipper2. If zipper1 > zipper2 then this is the same as slice zipper2 zipper1.

The result is unspecified if the two zippers do not points to the same rope.

OCaml

Innovation. Community. Security.