package grenier
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=658e1ad6fc5fdce0871975b3ebcb3ec760248be63cdb9ea965e3121cc7478d77
sha512=d9ff83f1b025f34c22af5921444993df219761dcee8d8cb5a940f266df8677278967434b22314c5c82d5d983e4c94c04cd52c4717d5c1f22fbd3a022631fae1c
doc/grenier.trope/Trope/index.html
Module TropeSource
Buffer management
Type of semi-persistent buffers
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
Type of cursors
Get the physical position of a cursor in a revision of a buffer
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_after c creates a cursor that is immediately after c.
cursor_before c creates a cursor that is immediately before 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