stdlib/strings: Renamed AbstractString to FlatText.
authorLucas Bajolet <r4pass@hotmail.com>
Fri, 7 Mar 2014 19:57:24 +0000 (14:57 -0500)
committerLucas Bajolet <r4pass@hotmail.com>
Mon, 24 Mar 2014 17:07:15 +0000 (13:07 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/ropes.nit
lib/standard/string.nit
src/debugger.nit

index 5470498..708be9a 100644 (file)
@@ -45,7 +45,7 @@ abstract class Rope
        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
@@ -276,7 +276,7 @@ abstract class Rope
        # 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
@@ -286,7 +286,7 @@ abstract class Rope
                                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
@@ -1039,7 +1039,7 @@ private class LeafNode
        # 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
index e4c9fe4..1dcbb31 100644 (file)
@@ -423,8 +423,8 @@ abstract class Text
 
 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
@@ -522,7 +522,7 @@ end
 # Immutable strings of characters.
 class String
        super Comparable
-       super AbstractString
+       super FlatText
        super StringCapable
 
        redef type OTHER: String
@@ -896,7 +896,7 @@ end
 
 # Mutable strings of characters.
 class FlatBuffer
-       super AbstractString
+       super FlatText
        super Comparable
        super StringCapable
        super Buffer
index 65725a8..54258df 100644 (file)
@@ -818,7 +818,7 @@ class Debugger
 
        # 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
@@ -866,7 +866,7 @@ class Debugger
 
        # 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