Stk.Rope
Rope to store text with tags.
This module should not be used directly by library user, but rather through the Textbuffer
module.
module Tag = Texttag.T
module TagSet = Texttag.TSet
A range is a start position and a size. Both are in Utf8 characters, not in byte.
val pp_range : Stdlib.Format.formatter -> range -> unit
val string_of_range : range -> string
val range : start:int -> size:int -> range
val zero_range : range
zero_range
is range ~start:0 size:0
. Typically used for accumulators start value.
and leaf = {
mutable parent : parent option;
a leaf with no parent means it is not part of the rope any more
*)mutable size : int;
mutable contents : Stdlib.Buffer.t;
}
val no_tag : TagSet.t * 'a option
val leaf_offset : leaf -> int option
val rope_size : t -> int
val check : t -> unit
val pp_leaf : Stdlib.Format.formatter -> leaf -> unit
val pp : Stdlib.Format.formatter -> t -> unit
val iter : (Stdlib.Buffer.t -> 'a) -> t -> 'a
val create : unit -> t
val update_parent_size : parent option -> int -> unit
val update_parent_left_size : node -> int -> unit
val update_parent_right_size : node -> int -> unit
val delete : t -> start:int -> size:int -> string
val of_string : string -> t
val to_buffer : ?b:Stdlib.Buffer.t -> t -> Stdlib.Buffer.t
val to_string : t -> string
val sub_to_buffer : Stdlib.Buffer.t -> start:int -> size:int -> t -> unit
val sub_to_string : ?b:'a -> start:int -> size:int -> t -> string
val sedlexbuf_refill :
?pos:int ->
?offset:int ->
t ->
Stdlib.Uchar.t array ->
int ->
int ->
int
val to_sedlexbuf : ?pos:int -> ?offset:int -> t -> Sedlexing.lexbuf
val remove_lang_tags : t -> unit