end
# Initializes a new Rope with a text embedded in directly
- init with_string(str: AbstractString) do
+ init with_string(str: String) do
self.parent_node = new ConcatNode
parent_node.as(ConcatNode).right_child = new LeafNode(str)
parent_node.as(ConcatNode).update_data
# Compares the current Rope to another object (either another rope or a String)
redef fun == (other)
do
- if other == null or not (other isa Rope or other isa AbstractString) then return false
+ if other == null or not (other isa Rope or other isa FlatText) then return false
var self_iter = new RopeCharIterator(self)
if other isa Rope then
if self.length != other.length then return false
self_iter.next
other_iterator.next
end
- else if other isa AbstractString then
+ else if other isa FlatText then
var pos = 0
if self.length != other.length then return false
while self_iter.is_ok do
# Encapsulated string in the leaf node
private var _value: String
- init(val: AbstractString)
+ init(val: String)
do
self._value = val.to_s
self.length = val.length
end
-# Common subclass for String and Buffer
-abstract class AbstractString
+# All kinds of array-based text representations.
+abstract class FlatText
super Text
private var items: NativeString
# Immutable strings of characters.
class String
super Comparable
- super AbstractString
+ super FlatText
super StringCapable
redef type OTHER: String
# Mutable strings of characters.
class FlatBuffer
- super AbstractString
+ super FlatText
super Comparable
super StringCapable
super Buffer
# Gets all the identifiers of an instruction (uses the rules of Nit as of Mar 05 2013)
#
- fun get_identifiers_in_current_instruction(instruction: AbstractString): Array[String]
+ fun get_identifiers_in_current_instruction(instruction: Text): Array[String]
do
var result_array = new Array[String]
var instruction_buffer = new FlatBuffer
# Takes a function call or declaration and strips all but the arguments
#
- fun get_function_arguments(function: AbstractString): String
+ fun get_function_arguments(function: Text): String
do
var buf = new FlatBuffer
var trigger_copy = false