Rope
core :: RopeByteIterator :: _max
Maximum position to iterate on (e.g. Rope.byte_length)core :: RopeByteIterator :: _subs
Substrings of the Ropecore :: RopeByteIterator :: defaultinit
core :: RopeByteIterator :: max
Maximum position to iterate on (e.g. Rope.byte_length)core :: RopeByteIterator :: max=
Maximum position to iterate on (e.g. Rope.byte_length)core :: RopeByteIterator :: subs
Substrings of the Ropecore :: RopeByteIterator :: subs=
Substrings of the Ropecore $ RopeByteIterator :: SELF
Type of this instance, automatically specialized in every classcore :: RopeByteIterator :: _max
Maximum position to iterate on (e.g. Rope.byte_length)core :: RopeByteIterator :: _subs
Substrings of the Ropecore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: RopeByteIterator :: defaultinit
core :: Iterator :: defaultinit
core :: IndexedIterator :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: RopeByteIterator :: max
Maximum position to iterate on (e.g. Rope.byte_length)core :: RopeByteIterator :: max=
Maximum position to iterate on (e.g. Rope.byte_length)core :: Object :: native_class_name
The class name of the object in CString format.Iterator
whose elements are sorted by the function
core :: Object :: output_class_name
Display class name on stdout (debug only).core :: RopeByteIterator :: subs
Substrings of the Ropecore :: RopeByteIterator :: subs=
Substrings of the Rope
# Forward iterator on the bytes of a `Rope`
private class RopeByteIterator
super IndexedIterator[Int]
# Position in current `String`
var pns: Int is noautoinit
# Current `String` being iterated on
var ns: CString is noautoinit
# Substrings of the Rope
var subs: IndexedIterator[FlatString] is noautoinit
# Maximum position to iterate on (e.g. Rope.byte_length)
var max: Int is noautoinit
# Position (char) in the Rope (0-indexed)
var pos: Int is noautoinit
init from(root: Concat, pos: Int) do
subs = new RopeSubstrings.from(root, pos)
pns = pos - subs.index
self.pos = pos
ns = subs.item._items
max = root.byte_length - 1
end
redef fun item do return ns[pns]
redef fun is_ok do return pos <= max
redef fun index do return pos
redef fun next do
pns += 1
pos += 1
if pns < subs.item._byte_length then return
if not subs.is_ok then return
subs.next
if not subs.is_ok then return
ns = subs.item._items
pns = 0
end
end
lib/core/text/ropes.nit:373,1--412,3