Rope
objectscore :: RopeByteReverseIterator :: _subs
Iterator on the substrings, does the Postfix part ofcore :: RopeByteReverseIterator :: subs
Iterator on the substrings, does the Postfix part ofcore :: RopeByteReverseIterator :: subs=
Iterator on the substrings, does the Postfix part ofcore $ RopeByteReverseIterator :: SELF
Type of this instance, automatically specialized in every classcore :: RopeByteReverseIterator :: _subs
Iterator on the substrings, does the Postfix part ofcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
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 :: 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 :: RopeByteReverseIterator :: subs
Iterator on the substrings, does the Postfix part ofcore :: RopeByteReverseIterator :: subs=
Iterator on the substrings, does the Postfix part of
# A reverse iterator capable of working with `Rope` objects
private class RopeByteReverseIterator
super IndexedIterator[Int]
# Current CString
var ns: CString is noautoinit
# Current position in CString
var pns: Int is noautoinit
# Position in the Rope (0-indexed)
var pos: Int is noautoinit
# Iterator on the substrings, does the Postfix part of
# the Rope traversal.
var subs: IndexedIterator[FlatString] is noautoinit
init from(root: Concat, pos: Int) do
self.pos = pos
subs = new ReverseRopeSubstrings.from(root, pos)
var s = subs.item
ns = s._items
pns = pos - subs.index
end
redef fun index do return pos
redef fun is_ok do return pos >= 0
redef fun item do return ns[pns]
redef fun next do
pns -= 1
pos -= 1
if pns >= 0 then return
if not subs.is_ok then return
subs.next
if not subs.is_ok then return
var s = subs.item
ns = s._items
pns = s.last_byte
end
end
lib/core/text/ropes.nit:332,1--371,3