package inquire
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=0b88d89e24d4cbc0560a7c8d8ec51388990e1b27f24685029997afa52a7c720f
sha512=8b62860a8d15e41528a404a6f1b9968c3d79755607b5ea319af2e3e45516e672a785361d278279910928db4054e1800e87bcee0210ff3eabfb330713b368c827
doc/inquire.zed/Zed_rope/Zip_raw/index.html
Module Zed_rope.Zip_raw
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 characters, not to a character, so in a rope of length len there is len + 1 positions.
make_f rope pos creates a new zipper pointing to raw positon pos of rope.
make_b rope pos creates a new zipper pointing to raw positon length rope - pos of rope.
val offset : t -> intReturns the raw position of the zipper in the rope.
next zipper returns the code point at the right of the zipper and a zipper to the next raw position. It raises Out_of_bounds if the zipper points to the end of the rope.
prev zipper returns the code point at the left of the zipper and a zipper to the previous raw position. It raises Out_of_bounds if the zipper points to the beginning of the rope.
move n zip moves the zipper by n characters. 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.
val at_bos : t -> boolat_bos zipper returns true if zipper points to the beginning of the rope.
val at_eos : t -> boolat_eos zipper returns true if zipper points to the end of the rope.
find_f f zip search forward for a character to satisfy f. It returns a zipper pointing to the left of the first character to satisfy f, or a zipper pointing to the end of the rope if no such character exists.