package grenier
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=622a34f91f2787096f15786901b8d8cff528cada805b018fdbd522c00c6f13e8
sha512=e687e7c9e7b61d876c70570a9b6e4f3a497c8deb334e28532d8c2f9a2a06bff1330431b64ec3e8c4bcfcf2cc9495723339196608c6c4ac5a0699020d0af93e26
doc/grenier.trope/Trope/index.html
Module Trope
Buffer management
val create : unit -> 'a t
Create a new lineage of buffers
val is_empty : 'a t -> bool
true iff is buffer empty ?
Shift contents of the buffer by removing len
units starting at at
. Valid iff at >= 0 && len >= 0
. Cursors exactly at position at
are removed iff called with ~left_of:()
.
Shift contents of the buffer by inserting len
units starting at at
. Valid iff at >= 0 && len >= 0
. Cursors exactly at position at
are shifted iff called with ~left_of:()
.
Cursor management
Creation and removal of cursors
Create a new cursors at position at
Valid iff at >= 0
.
Insert or update a cursor. Cursor is inserted at the left-most valid position.
Insert or update a cursor. Cursor is inserted at the right-most valid position before buffer end.
rem_cursor t c
removes a cursor from the buffer. Valid iff member t c
.
cursor_at_origin t
creates a cursor that is minimal for t
(before all other cursors in t
)
Modification of buffers
Remove anything between two cursors. remove_between t a b
is valid iff member t a && member t b && compare a b <= 0
remove_before t c len
removes len
units before c
. Valid iff member t c && len >= 0
.
remove_after t c len
removes len
units after c
. Valid iff member t c && len >= 0
.
insert_before t c len
inserts len
units before c
. Valid iff member t c && len >= 0
.
insert_before t c len
inserts len
units after c
. Valid iff member t c && len >= 0
.
Looking up cursors in the buffer
find_before t at
finds the last cursor c
in t
satisfying position t c <= at
find_after t at
finds the first cursor c
in t
satisfying position t c >= at
seek_before t c
finds the last cursor c'
in t
satisfying compare c' c < 0
seek_after t c
finds the first cursor c'
in t
satisfying compare c' c > 0