lib/core: Remove RopeBuffer from lib
authorLucas Bajolet <r4pass@hotmail.com>
Tue, 5 Jul 2016 15:41:37 +0000 (11:41 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Mon, 11 Jul 2016 18:21:38 +0000 (14:21 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

37 files changed:
contrib/neo_doxygen/src/tests/neo_doxygen_dump.nit
contrib/neo_doxygen/src/tests/neo_doxygen_file_compound.nit
contrib/neo_doxygen/src/tests/neo_doxygen_graph_empty_project.nit
contrib/neo_doxygen/src/tests/neo_doxygen_namespace_members.nit
lib/core/text/ropes.nit
lib/core/text/test_abstract_text.nit
lib/neo4j/neo4j.nit
lib/ropes_debug.nit
lib/text_stat.nit
src/doc/doc_phases/doc_indexing.nit
tests/bench_string_append.nit
tests/example_procedural_string.nit
tests/example_string.nit
tests/sav/bench_string_append_alt1.res [deleted file]
tests/sav/example_procedural_string_alt1.res [deleted file]
tests/sav/example_string_alt1.res [deleted file]
tests/sav/string_trim_alt1.res [deleted file]
tests/sav/test_buffer_unicode_alt1.res [deleted file]
tests/sav/test_ropes_buffer_add_overflow.res [deleted file]
tests/sav/test_ropes_buffer_clear.res [deleted file]
tests/sav/test_ropes_buffer_reverse.res [deleted file]
tests/sav/test_ropes_buffer_to_s.res [deleted file]
tests/sav/test_string_bytes.res
tests/sav/test_text_alt3.res [deleted file]
tests/sav/test_text_stat.res
tests/sav/test_to_upper_lower_buffer_alt1.res [deleted file]
tests/string_trim.nit
tests/test_buffer_unicode.nit
tests/test_ropebuffer.nit [deleted file]
tests/test_ropes_buffer_add_overflow.nit [deleted file]
tests/test_ropes_buffer_clear.nit [deleted file]
tests/test_ropes_buffer_reverse.nit [deleted file]
tests/test_ropes_buffer_to_s.nit [deleted file]
tests/test_string_bytes.nit
tests/test_string_long.nit
tests/test_text.nit
tests/test_to_upper_lower_buffer.nit

index f52cd01..f594de9 100644 (file)
@@ -48,7 +48,7 @@ class DebugStore
                print ""
                for n in neo_entities do
                        if n isa NeoEdge then
-                               var buffer = new RopeBuffer
+                               var buffer = new Buffer
                                n.debug buffer
                                print buffer
                        end
index c66709e..3b1f6a4 100644 (file)
@@ -24,7 +24,7 @@ var a_ns = new Namespace(graph)
 var b_ns = new Namespace(graph)
 var c_ns = new Namespace(graph)
 var d_ns = new Namespace(graph)
-var buffer = new RopeBuffer
+var buffer = new Buffer
 var root_ns = graph.by_id[""].as(Namespace)
 var location: Location
 
index f011ae8..1847625 100644 (file)
@@ -15,7 +15,7 @@
 import tests
 
 var graph = new ProjectGraph("foo")
-var buffer = new RopeBuffer
+var buffer = new Buffer
 
 graph.put_edges
 graph.debug buffer
index 4030df9..bf0a62f 100644 (file)
@@ -20,7 +20,7 @@ var file = new FileCompound(graph)
 var root_ns = graph.by_id[""].as(Namespace)
 var ns = new Namespace(graph)
 var member = new Attribute(graph)
-var buffer = new RopeBuffer
+var buffer = new Buffer
 
 file.name = "foo.py"
 file.model_id = "_foo_8py"
index 5ca487a..ac95851 100644 (file)
@@ -281,292 +281,6 @@ private class Concat
        end
 end
 
-# Mutable `Rope`, optimized for concatenation operations
-#
-# A `RopeBuffer` is an efficient way of building a `String` when
-# concatenating small strings.
-#
-# It does concatenations in an optimized way by having a
-# mutable part and an immutable part built by efficiently
-# concatenating strings in chain.
-#
-# Every concatenation operation is done by copying a string to
-# the mutable part and flushing it when full.
-#
-# However, when a long string is appended to the `Buffer`,
-# the concatenation is done at it would be in a `Rope`.
-class RopeBuffer
-       super Rope
-       super Buffer
-
-       redef fun chars do return new RopeBufferChars(self)
-
-       redef fun bytes do return new RopeBufferBytes(self)
-
-       # The final string being built on the fly
-       private var str: String = ""
-
-       # Current concatenation buffer
-       private var ns: NativeString is noinit
-
-       # Next available (e.g. unset) character in the `Buffer`
-       private var rpos = 0
-
-       # Length (in chars) of the buffered part
-       private var nslen = 0
-
-       # Keeps track of the buffer's currently dumped part
-       #
-       # This might happen if for instance, a String was being
-       # built by concatenating small parts of string and suddenly
-       # a long string (length > maxlen) is appended.
-       private var dumped: Int is noinit
-
-       # Length of the complete rope in chars (0)
-       redef fun length do
-               var st = dumped
-               var len = str.length
-               while st < rpos do
-                       st += ns[st].u8len
-                       len += 1
-               end
-               return len
-       end
-
-       # Length of the complete rope in bytes
-       redef var byte_length = 0
-
-       # Length of the mutable part (in bytes)
-       #
-       # Is also used as base to compute the size of the next
-       # mutable native string (`ns`)
-       private var buf_size: Int is noinit
-
-       redef fun substrings do return new RopeBufSubstringIterator.from(self)
-
-       # Builds an empty `RopeBuffer`
-       init do
-               ns = new NativeString(maxlen)
-               buf_size = maxlen
-               dumped = 0
-       end
-
-       # Builds a new `RopeBuffer` with `str` in it.
-       init from(str: String) do
-               self.str = str
-               ns = new NativeString(maxlen)
-               buf_size = maxlen
-               _byte_length = str.length
-               dumped = 0
-       end
-
-       # Resets the informations of the `Buffer`
-       #
-       # This is called when doing in-place modifications
-       # on a previously to_s'd `RopeBuffer`
-       private fun reset do
-               var nns = new NativeString(buf_size)
-               var blen = rpos - dumped
-               ns.copy_to(nns, blen, dumped, 0)
-               ns = nns
-               dumped = 0
-               rpos = blen
-               written = false
-       end
-
-       redef fun [](i) do
-               if i < str.length then
-                       return str[i]
-               else
-                       var index = ns.char_to_byte_index_cached(i - str.length, 0, dumped)
-                       return ns.char_at(index)
-               end
-       end
-
-       redef fun []=(i, c) do
-               assert i >= 0 and i <= length
-               if i == length then add c
-               if i < str.length then
-                       _byte_length += c.u8char_len - str[i].u8char_len
-                       var s = str
-                       var l = s.substring(0, i)
-                       var r = s.substring_from(i + 1)
-                       str = l + c.to_s + r
-               else
-                       var reali = i - str.length
-                       var index = ns.char_to_byte_index_cached(reali, 0, dumped)
-                       var st_nxt = ns.char_to_byte_index_cached(reali + 1, reali, index)
-                       var loc_c = ns.char_at(index)
-                       if loc_c.u8char_len != c.u8char_len then
-                               var delta = c.u8char_len - loc_c.u8char_len
-                               var remsp = buf_size - rpos
-                               if remsp < delta then
-                                       buf_size *= 2
-                                       var nns = new NativeString(buf_size)
-                                       ns.copy_to(nns, index - dumped, dumped, 0)
-                                       ns.copy_to(nns, rpos - index - loc_c.u8char_len, index + loc_c.u8char_len, index - dumped + delta)
-                                       ns = nns
-                                       index = index - dumped
-                               else
-                                       ns.copy_to(ns, rpos - st_nxt, st_nxt, st_nxt + delta)
-                               end
-                               _byte_length += delta
-                               rpos += delta
-                       end
-                       ns.set_char_at(index, c)
-               end
-       end
-
-       redef fun empty do return new RopeBuffer
-
-       redef fun clear do
-               str = ""
-               _byte_length = 0
-               rpos = 0
-               dumped = 0
-               if written then
-                       ns = new NativeString(buf_size)
-                       written = false
-               end
-       end
-
-       redef fun substring(from, count) do
-               var strlen = str.length
-
-               if from < 0 then
-                       count += from
-                       if count < 0 then count = 0
-                       from = 0
-               end
-
-               if count > length then count = length - from
-
-               if count == 0 then return empty
-
-               if from < strlen then
-                       var subpos = strlen - from
-                       if count <= subpos then
-                               return new RopeBuffer.from(str.substring(from, count))
-                       else
-                               var l = str.substring_from(from)
-                               var rem = count - subpos
-                               var nns = new NativeString(rem)
-                               ns.copy_to(nns, rem, dumped, 0)
-                               return new RopeBuffer.from(l + nns.to_s_unsafe(rem))
-                       end
-               else
-                       var nns = new NativeString(count)
-                       ns.copy_to(nns, count, dumped, 0)
-                       return new RopeBuffer.from(nns.to_s_unsafe(count))
-               end
-       end
-
-       redef fun append(s) do
-               var slen = s.byte_length
-               if slen >= maxlen then
-                       persist_buffer
-                       str += s.to_s
-                       return
-               end
-               if s isa FlatText then
-                       var oits = s._items
-                       var from = s.first_byte
-                       var remsp = buf_size - rpos
-                       if slen <= remsp then
-                               oits.copy_to(ns, slen, from, rpos)
-                               rpos += slen
-                               return
-                       end
-                       var brk = oits.find_beginning_of_char_at(from + remsp)
-                       oits.copy_to(ns, brk, from, rpos)
-                       rpos += brk
-                       dump_buffer
-                       oits.copy_to(ns, slen - remsp, brk, 0)
-                       rpos = slen - remsp
-               else
-                       for i in s.substrings do append i
-               end
-       end
-
-       redef fun add(c) do
-               var rp = rpos
-               var remsp = buf_size - rp
-               var cln = c.u8char_len
-               if cln > remsp then
-                       dump_buffer
-                       rp = 0
-               end
-               ns.set_char_at(rp, c)
-               rp += cln
-               _byte_length += cln
-               rpos = rp
-       end
-
-       # Converts the Buffer to a FlatString, appends it to
-       # the final String and re-allocates a new larger Buffer.
-       private fun dump_buffer do
-               written = false
-               var nstr = new FlatString.with_infos(ns, rpos - dumped, dumped)
-               str += nstr
-               var bs = buf_size
-               bs = bs * 2
-               ns = new NativeString(bs)
-               buf_size = bs
-               dumped = 0
-               rpos = 0
-       end
-
-       # Similar to dump_buffer, but does not reallocate a new NativeString
-       private fun persist_buffer do
-               if rpos == dumped then return
-               var nstr = new FlatString.with_infos(ns, rpos - dumped, dumped)
-               str += nstr
-               dumped = rpos
-       end
-
-       redef fun output do
-               str.output
-               new FlatString.with_infos(ns, rpos - dumped, dumped).output
-       end
-
-       # Enlarge is useless here since the `Buffer`
-       # part is automatically dumped when necessary.
-       #
-       # Also, since the buffer can not be overused by a
-       # single string, there is no need for manual
-       # resizing.
-       #
-       # "You have no power here !"
-       redef fun enlarge(i) do end
-
-       redef fun to_s do
-               persist_buffer
-               written = true
-               return str
-       end
-
-       redef fun reverse do
-               # Flush the buffer in order to only have to reverse `str`.
-               if rpos > 0 and dumped != rpos then
-                       str += new FlatString.with_infos(ns, rpos - dumped, dumped)
-                       dumped = rpos
-               end
-               str = str.reversed
-       end
-
-       redef fun upper do
-               if written then reset
-               persist_buffer
-               str = str.to_upper
-       end
-
-       redef fun lower do
-               if written then reset
-               persist_buffer
-               str = str.to_lower
-       end
-end
-
 redef class FlatString
 
        redef fun insert_at(s, pos) do
@@ -849,39 +563,6 @@ private class ReverseRopeSubstrings
        end
 end
 
-private class RopeBufSubstringIterator
-       super Iterator[FlatText]
-
-       # Iterator on the substrings of the building string
-       var iter: Iterator[FlatText] is noautoinit
-       # Makes a String out of the buffered part of the Ropebuffer
-       var nsstr: FlatString is noautoinit
-       # Did we attain the buffered part ?
-       var nsstr_done = false
-
-       init from(str: RopeBuffer) do
-               iter = str.str.substrings
-               nsstr = new FlatString.with_infos(str.ns, str.rpos - str.dumped, str.dumped)
-               if str.length == 0 then nsstr_done = true
-       end
-
-       redef fun is_ok do return iter.is_ok or not nsstr_done
-
-       redef fun item do
-               assert is_ok
-               if iter.is_ok then return iter.item
-               return nsstr
-       end
-
-       redef fun next do
-               if iter.is_ok then
-                       iter.next
-                       return
-               end
-               nsstr_done = true
-       end
-end
-
 # Substrings of a Rope (i.e. Postfix iterator on leaves)
 private class RopeSubstrings
        super IndexedIterator[FlatString]
@@ -1026,175 +707,3 @@ private class RopeBytes
        redef fun reverse_iterator_from(i) do return new RopeByteReverseIterator.from(target, i)
 
 end
-
-# An Iterator over a RopeBuffer.
-class RopeBufferCharIterator
-       super IndexedIterator[Char]
-
-       # Subiterator.
-       var sit: IndexedIterator[Char] is noautoinit
-
-       redef fun index do return sit.index
-
-       # Init the iterator from a RopeBuffer starting from `pos`.
-       init from(t: RopeBuffer, pos: Int) do
-               t.persist_buffer
-               sit = t.str.chars.iterator_from(pos)
-       end
-
-       redef fun is_ok do return sit.is_ok
-
-       redef fun item do
-               assert is_ok
-               return sit.item
-       end
-
-       redef fun next do sit.next
-end
-
-# Reverse iterator over a RopeBuffer.
-class RopeBufferCharReverseIterator
-       super IndexedIterator[Char]
-
-       # Subiterator.
-       var sit: IndexedIterator[Char] is noautoinit
-
-       redef fun index do return sit.index
-
-       # Init the iterator from a RopeBuffer starting from `pos`.
-       init from(tgt: RopeBuffer, pos: Int) do
-               tgt.persist_buffer
-               sit = tgt.str.chars.reverse_iterator_from(pos)
-       end
-
-       redef fun is_ok do return sit.is_ok
-
-       redef fun item do
-               assert is_ok
-               return sit.item
-       end
-
-       redef fun next do sit.next
-end
-
-# View on the chars of a `RopeBuffer`
-class RopeBufferChars
-       super BufferCharView
-
-       redef type SELFTYPE: RopeBuffer
-
-       redef fun [](i) do return target[i]
-
-       redef fun []=(i,c) do target[i] = c
-
-       redef fun add(c) do target.add c
-
-       redef fun push(c) do target.add c
-
-       redef fun iterator_from(i) do return new RopeBufferCharIterator.from(target, i)
-
-       redef fun reverse_iterator_from(i) do return new RopeBufferCharReverseIterator.from(target, i)
-end
-
-# An Iterator over a RopeBuffer.
-class RopeBufferByteIterator
-       super IndexedIterator[Byte]
-
-       # Subiterator.
-       var sit: IndexedIterator[Byte] is noautoinit
-
-       # Native string iterated over.
-       var ns: NativeString is noautoinit
-
-       # Current position in `ns`.
-       var pns: Int is noautoinit
-
-       # Maximum position iterable.
-       var maxpos: Int is noautoinit
-
-       redef var index is noautoinit
-
-       # Init the iterator from a RopeBuffer starting from `pos`.
-       init from(t: RopeBuffer, pos: Int) do
-               ns = t.ns
-               maxpos = t._byte_length
-               sit = t.str.bytes.iterator_from(pos)
-               pns = pos - t.str.length
-               index = pos
-       end
-
-       redef fun is_ok do return index < maxpos
-
-       redef fun item do
-               if sit.is_ok then return sit.item
-               return ns[pns]
-       end
-
-       redef fun next do
-               index += 1
-               if sit.is_ok then
-                       sit.next
-               else
-                       pns += 1
-               end
-       end
-end
-
-# Reverse iterator over a RopeBuffer.
-class RopeBufferByteReverseIterator
-       super IndexedIterator[Byte]
-
-       # Subiterator.
-       var sit: IndexedIterator[Byte] is noautoinit
-
-       # Native string iterated over.
-       var ns: NativeString is noautoinit
-
-       # Current position in `ns`.
-       var pns: Int is noautoinit
-
-       redef var index is noautoinit
-
-       # Init the iterator from a RopeBuffer starting from `pos`.
-       init from(tgt: RopeBuffer, pos: Int) do
-               sit = tgt.str.bytes.reverse_iterator_from(pos - (tgt.rpos - tgt.dumped))
-               pns = pos - tgt.str.byte_length + tgt.rpos
-               index = pos
-               ns = tgt.ns
-       end
-
-       redef fun is_ok do return index >= 0
-
-       redef fun item do
-               if pns >= 0 then return ns[pns]
-               return sit.item
-       end
-
-       redef fun next do
-               index -= 1
-               if pns >= 0 then
-                       pns -= 1
-               else
-                       sit.next
-               end
-       end
-end
-
-# View on the chars of a `RopeBuffer`
-class RopeBufferBytes
-       super BufferByteView
-
-       redef type SELFTYPE: RopeBuffer
-
-       redef fun [](i) do
-               if i < target.str.byte_length then
-                       return target.str.bytes[i]
-               else
-                       return target.ns[i - target.str.byte_length]
-               end
-       end
-
-       redef fun iterator_from(i) do return new RopeBufferByteIterator.from(target, i)
-
-       redef fun reverse_iterator_from(i) do return new RopeBufferByteReverseIterator.from(target, i)
-end
index c67a991..af7dc00 100644 (file)
@@ -19,7 +19,6 @@ class TestText
 
        private var factories: Collection[TextFactory] = [
                new ConcatFactory,
-               new RopeBufferFactory,
                new FlatBufferFactory
        : TextFactory]
 
@@ -47,13 +46,6 @@ class ConcatFactory
 
        redef fun create(s) do return new Concat("", s)
 end
-
-class RopeBufferFactory
-       super TextFactory
-
-       redef fun create(s) do return new RopeBuffer.from(s)
-end
-
 class FlatBufferFactory
        super TextFactory
 
index c6c005a..3dffc93 100644 (file)
@@ -289,7 +289,7 @@ class Neo4jClient
                assert not labels.is_empty
 
                # Build the query.
-               var buffer = new RopeBuffer
+               var buffer = new Buffer
                buffer.append "match n where \{label_0\} in labels(n)"
                for i in [1..labels.length[ do
                        buffer.append " and \{label_{i}\} in labels(n)"
index 1fa3638..ab8d892 100644 (file)
@@ -21,13 +21,14 @@ redef class Text
        # Writes self as a dot file on the hard drive
        private fun internal_to_dot: String is abstract
 
+       # Returns the graphviz-formatted content of `self`
        fun to_dot: String do
                return "digraph g \{\n" + internal_to_dot + "\}\n"
        end
 end
 
 redef class Concat
-       redef fun internal_to_dot: String
+       redef fun internal_to_dot
        do
                var s = "n{object_id} [label = {length}];\n"
                s += "n{object_id} -> n{left.object_id} [label = \"left\"];\n"
@@ -38,27 +39,15 @@ redef class Concat
        end
 end
 
-redef class RopeBuffer
-       redef fun internal_to_dot: String
-       do
-               var s = "n{object_id} [label = {length}];\n"
-               s += "n{object_id} -> n{str.object_id} [label = \"str\"];\n"
-               s += str.internal_to_dot
-               s += "n{object_id} -> n{ns.object_id} [label = \"ns\"];\n"
-               s += "n{ns.object_id}[label = \"Items\", content=\"{ns}\"];\n"
-               return s
-       end
-end
-
 redef class FlatString
-       redef fun internal_to_dot: String
+       redef fun internal_to_dot
        do
                return "n{object_id} [label=\"FlatString\\nlength = {length}\\nbyte_length = {byte_length}\\nfirst_byte = {first_byte}\\nlast_byte = {last_byte}\\nText = {self.escape_to_dot}\"];\n"
        end
 end
 
 redef class FlatBuffer
-       redef fun internal_to_dot: String
+       redef fun internal_to_dot
        do
                return "n{object_id} [label=\"FlatBuffer\\nbyte_length = {byte_length}\\nlength = {length}\\ncapacity = {capacity}\\nText = {escape_to_dot}\"];\n"
        end
index e4dab5f..6583db4 100644 (file)
@@ -33,9 +33,6 @@ redef class Sys
        # Counts the number of allocations of Concat
        var concat_allocations = 0
 
-       # Counts the number of allocations of RopeBuffer
-       var ropebuf_allocations = 0
-
        # Counts the number of calls to property length
        var length_calls = new Counter[String]
 
@@ -83,7 +80,6 @@ Allocations, by type:
                print "\t-ASCIIFlatString = {asciiflatstr_allocations}"
                print "\t-FlatBuffer = {flatbuf_allocations}"
                print "\t-Concat = {concat_allocations}"
-               print "\t-RopeBuffer = {ropebuf_allocations}"
                print ""
                print "Calls to length, by type:"
                for k, v in length_calls do
@@ -216,22 +212,6 @@ redef class FlatText
        end
 end
 
-redef class RopeBuffer
-       init do
-               sys.ropebuf_allocations += 1
-       end
-
-       redef fun byte_length do
-               sys.byte_length_call.inc "RopeBuffer"
-               return super
-       end
-
-       redef fun [](i) do
-               sys.index_call.inc "RopeBuffer"
-               return super
-       end
-end
-
 redef class FlatBuffer
 
        init do
index 5d0b9c3..d532d9c 100644 (file)
@@ -64,7 +64,7 @@ class IndexingPhase
        # Render the index content.
        fun render: Template do
                var tpl = new Template
-               var buffer = new RopeBuffer
+               var buffer = new Buffer
                tpl.add buffer
                buffer.append "var nitdocQuickSearchRawList="
                table.append_json buffer
index b7df069..2fec554 100644 (file)
@@ -14,9 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import core
-#alt1 import core::text::ropes
-
 var n = 4
 if not args.is_empty then
        n = args.first.to_i
@@ -26,7 +23,6 @@ var s = "*"
 var i = 0
 while i < n do
        var s2: Buffer = new FlatBuffer.from("Je dis «")
-       #alt1 s2 = new RopeBuffer.from("Je dis «")
        s2.append(s)
        s2.append("» et redis «")
        s2.append(s)
index 4fbd8a9..a53669d 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import core
-#alt1 import core::text::ropes
-
 # A procedural program (without explicit class).
 
 fun first_word(s: String): String
 do
        var result: Buffer = new FlatBuffer
-       #alt1 result = new RopeBuffer
        var i = 0
        while i < s.length and s.chars[i] != ' ' do
                result.add(s.chars[i])
index b2d800e..8824617 100644 (file)
@@ -18,9 +18,6 @@
 # It displays the value of a local variable.
 # It exhibs ways to concatenate strings.
 
-#alt1 import core
-#alt1 import core::text::ropes
-
 var a = 10
 # First way: Multiple parameters.
 # Pro: Simple.
@@ -31,7 +28,6 @@ printn("The value of a is: ", a, ".\n")
 # Pro: Eiffel way (rigourous).
 # Con: Eiffel way (heavy).
 var s: Buffer = new FlatBuffer.from("The value of a is: ")
-#alt1 s = new RopeBuffer.from("The value of a is: ")
 s.append(a.to_s)
 s.append(".\n")
 printn(s)
diff --git a/tests/sav/bench_string_append_alt1.res b/tests/sav/bench_string_append_alt1.res
deleted file mode 100644 (file)
index 0abbce4..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-17
-21
-2295
diff --git a/tests/sav/example_procedural_string_alt1.res b/tests/sav/example_procedural_string_alt1.res
deleted file mode 100644 (file)
index e965047..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Hello
diff --git a/tests/sav/example_string_alt1.res b/tests/sav/example_string_alt1.res
deleted file mode 100644 (file)
index 02444a6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-The value of a is: 10.
-The value of a is: 10.
-The value of a is: 10.
-The value of a is: 10.
-The value of a is: 10.
diff --git a/tests/sav/string_trim_alt1.res b/tests/sav/string_trim_alt1.res
deleted file mode 100644 (file)
index 24d9987..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-resulttrim = nono nono
-returntrim + nono nono
-thirdtrim = nono nono
-emptytrim = 
-bufferemptytrim = 
-onelettertrim = d
-oneletterbuftest = d
-twolettertrim = hg
-twoletterbuftest = hg
-firstlettertrimtest = d
-firstlettertrimbuftest = d
-lastlettertrimtest = d
-lastlettertrimbuftest = d
diff --git a/tests/sav/test_buffer_unicode_alt1.res b/tests/sav/test_buffer_unicode_alt1.res
deleted file mode 100644 (file)
index 08fb25a..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-Char 0 = 𐏓
-Char 1 = A
-Char 2 = A
-Char 3 = A
-Char 4 = A
-Char 5 = A
-Char 6 = A
-Char 7 = A
-Char 8 = A
-Char 9 = A
-Char 10 = A
-Char 11 = A
-Char 12 = A
-Char 13 = A
-Char 14 = A
-Char 15 = A
-Char 16 = A
-Char 17 = A
-Char 18 = A
-Char 19 = A
-Char 20 = A
-Char 21 = A
-Char 22 = A
-Char 23 = A
-Char 24 = A
-Char 25 = A
-Char 26 = A
-Char 27 = A
-Char 28 = A
-Char 29 = A
-Char 30 = A
-Char 31 = A
-Char 32 = Z
-Char 33 = A
-Char 34 = A
-Char 35 = A
-Char 36 = A
-Char 37 = A
-Char 38 = A
-Char 39 = A
-Char 40 = A
-Char 41 = A
-Char 42 = A
-Char 43 = A
-Char 44 = A
-Char 45 = A
-Char 46 = A
-Char 47 = A
-Char 48 = A
-Char 49 = A
-Char 50 = A
-Char 51 = A
-Char 52 = A
-Char 53 = A
-Char 54 = A
-Char 55 = A
-Char 56 = A
-Char 57 = A
-Char 58 = A
-Char 59 = A
-Char 60 = A
-Char 61 = A
-Char 62 = A
-Char 63 = あ
-Byte 0 = 0xf0
-Byte 1 = 0x90
-Byte 2 = 0x8f
-Byte 3 = 0x93
-Byte 4 = 0x41
-Byte 5 = 0x41
-Byte 6 = 0x41
-Byte 7 = 0x41
-Byte 8 = 0x41
-Byte 9 = 0x41
-Byte 10 = 0x41
-Byte 11 = 0x41
-Byte 12 = 0x41
-Byte 13 = 0x41
-Byte 14 = 0x41
-Byte 15 = 0x41
-Byte 16 = 0x41
-Byte 17 = 0x41
-Byte 18 = 0x41
-Byte 19 = 0x41
-Byte 20 = 0x41
-Byte 21 = 0x41
-Byte 22 = 0x41
-Byte 23 = 0x41
-Byte 24 = 0x41
-Byte 25 = 0x41
-Byte 26 = 0x41
-Byte 27 = 0x41
-Byte 28 = 0x41
-Byte 29 = 0x41
-Byte 30 = 0x41
-Byte 31 = 0x41
-Byte 32 = 0x41
-Byte 33 = 0x41
-Byte 34 = 0x41
-Byte 35 = 0x5a
-Byte 36 = 0x41
-Byte 37 = 0x41
-Byte 38 = 0x41
-Byte 39 = 0x41
-Byte 40 = 0x41
-Byte 41 = 0x41
-Byte 42 = 0x41
-Byte 43 = 0x41
-Byte 44 = 0x41
-Byte 45 = 0x41
-Byte 46 = 0x41
-Byte 47 = 0x41
-Byte 48 = 0x41
-Byte 49 = 0x41
-Byte 50 = 0x41
-Byte 51 = 0x41
-Byte 52 = 0x41
-Byte 53 = 0x41
-Byte 54 = 0x41
-Byte 55 = 0x41
-Byte 56 = 0x41
-Byte 57 = 0x41
-Byte 58 = 0x41
-Byte 59 = 0x41
-Byte 60 = 0x41
-Byte 61 = 0x41
-Byte 62 = 0x41
-Byte 63 = 0x41
-Byte 64 = 0x41
-Byte 65 = 0x41
-Byte 66 = 0xe3
-Byte 67 = 0x81
-Byte 68 = 0x82
-Char 63 = あ
-Char 62 = A
-Char 61 = A
-Char 60 = A
-Char 59 = A
-Char 58 = A
-Char 57 = A
-Char 56 = A
-Char 55 = A
-Char 54 = A
-Char 53 = A
-Char 52 = A
-Char 51 = A
-Char 50 = A
-Char 49 = A
-Char 48 = A
-Char 47 = A
-Char 46 = A
-Char 45 = A
-Char 44 = A
-Char 43 = A
-Char 42 = A
-Char 41 = A
-Char 40 = A
-Char 39 = A
-Char 38 = A
-Char 37 = A
-Char 36 = A
-Char 35 = A
-Char 34 = A
-Char 33 = A
-Char 32 = Z
-Char 31 = A
-Char 30 = A
-Char 29 = A
-Char 28 = A
-Char 27 = A
-Char 26 = A
-Char 25 = A
-Char 24 = A
-Char 23 = A
-Char 22 = A
-Char 21 = A
-Char 20 = A
-Char 19 = A
-Char 18 = A
-Char 17 = A
-Char 16 = A
-Char 15 = A
-Char 14 = A
-Char 13 = A
-Char 12 = A
-Char 11 = A
-Char 10 = A
-Char 9 = A
-Char 8 = A
-Char 7 = A
-Char 6 = A
-Char 5 = A
-Char 4 = A
-Char 3 = A
-Char 2 = A
-Char 1 = A
-Char 0 = 𐏓
-Byte 68 = 0x82
-Byte 67 = 0x81
-Byte 66 = 0xe3
-Byte 65 = 0x41
-Byte 64 = 0x41
-Byte 63 = 0x41
-Byte 62 = 0x41
-Byte 61 = 0x41
-Byte 60 = 0x41
-Byte 59 = 0x41
-Byte 58 = 0x41
-Byte 57 = 0x41
-Byte 56 = 0x41
-Byte 55 = 0x41
-Byte 54 = 0x41
-Byte 53 = 0x41
-Byte 52 = 0x41
-Byte 51 = 0x41
-Byte 50 = 0x41
-Byte 49 = 0x41
-Byte 48 = 0x41
-Byte 47 = 0x41
-Byte 46 = 0x41
-Byte 45 = 0x41
-Byte 44 = 0x41
-Byte 43 = 0x41
-Byte 42 = 0x41
-Byte 41 = 0x41
-Byte 40 = 0x41
-Byte 39 = 0x41
-Byte 38 = 0x41
-Byte 37 = 0x41
-Byte 36 = 0x41
-Byte 35 = 0x5a
-Byte 34 = 0x41
-Byte 33 = 0x41
-Byte 32 = 0x41
-Byte 31 = 0x41
-Byte 30 = 0x41
-Byte 29 = 0x41
-Byte 28 = 0x41
-Byte 27 = 0x41
-Byte 26 = 0x41
-Byte 25 = 0x41
-Byte 24 = 0x41
-Byte 23 = 0x41
-Byte 22 = 0x41
-Byte 21 = 0x41
-Byte 20 = 0x41
-Byte 19 = 0x41
-Byte 18 = 0x41
-Byte 17 = 0x41
-Byte 16 = 0x41
-Byte 15 = 0x41
-Byte 14 = 0x41
-Byte 13 = 0x41
-Byte 12 = 0x41
-Byte 11 = 0x41
-Byte 10 = 0x41
-Byte 9 = 0x41
-Byte 8 = 0x41
-Byte 7 = 0x41
-Byte 6 = 0x41
-Byte 5 = 0x41
-Byte 4 = 0x41
-Byte 3 = 0x93
-Byte 2 = 0x8f
-Byte 1 = 0x90
-Byte 0 = 0xf0
diff --git a/tests/sav/test_ropes_buffer_add_overflow.res b/tests/sav/test_ropes_buffer_add_overflow.res
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/sav/test_ropes_buffer_clear.res b/tests/sav/test_ropes_buffer_clear.res
deleted file mode 100644 (file)
index 951dbb9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-23
-3
diff --git a/tests/sav/test_ropes_buffer_reverse.res b/tests/sav/test_ropes_buffer_reverse.res
deleted file mode 100644 (file)
index eb577ea..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-//
-yxxxx
diff --git a/tests/sav/test_ropes_buffer_to_s.res b/tests/sav/test_ropes_buffer_to_s.res
deleted file mode 100644 (file)
index 5bff6e1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-`clear` and `append`: abcd
-`clear` and `add`: ab
-`add` at `maxlen + 1`: c
-`append` up to `maxlen + 1`: ab
-`reverse`: xyz
-`upper`: foo
-`lower`: BAR
index 2984735..8e3a30b 100644 (file)
@@ -6,5 +6,3 @@
 [0x6c,0x6f,0x6f,0x63,0x20,0x73,0x69,0x20,0x67,0x6e,0x69,0x72,0x74,0x73,0x20,0x73,0x69,0x68,0x54,0x6c,0x6f,0x6f,0x63,0x20,0x73,0x69,0x20,0x67,0x6e,0x69,0x72,0x74,0x73,0x20,0x73,0x69,0x68,0x54,0x6c,0x6f,0x6f,0x63,0x20,0x73,0x69,0x20,0x67,0x6e,0x69,0x72,0x74,0x73,0x20,0x73,0x69,0x68,0x54,0x6c,0x6f,0x6f,0x63,0x20,0x73,0x69,0x20,0x67,0x6e,0x69,0x72,0x74,0x73,0x20,0x73,0x69,0x68,0x54]
 [0x54,0x68,0x69,0x73,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x69,0x73,0x20,0x63,0x6f,0x6f,0x6c]
 [0x6c,0x6f,0x6f,0x63,0x20,0x73,0x69,0x20,0x67,0x6e,0x69,0x72,0x74,0x73,0x20,0x73,0x69,0x68,0x54]
-[0x54,0x68,0x69,0x73,0x20,0x73,0x74,0x72,0x69,0x6e,0x67,0x20,0x69,0x73,0x20,0x63,0x6f,0x6f,0x6c]
-[0x6c,0x6f,0x6f,0x63,0x20,0x73,0x69,0x20,0x67,0x6e,0x69,0x72,0x74,0x73,0x20,0x73,0x69,0x68,0x54]
diff --git a/tests/sav/test_text_alt3.res b/tests/sav/test_text_alt3.res
deleted file mode 100644 (file)
index 9a83175..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Woe to you, oh earth and sea for the Devil sends the beast with wrath because he knows the time is short.
-Let him who hath understanding reckon the number of the beast, for it is a human number, its number is Six Hundred and Sixty-Six.
-235
-13
-110
--1
-106
-37
-true
-true
-Woe to you, oh earth and sea for the Devil sends the beast with wrath because he knows the time is short. Let him who hath understanding reckon the number of the beast, for it is a human number, its number is Six Hundred and Sixty-Six.
-W o e   t o   y o u ,   o h   e a r t h   a n d   s e a   f o r   t h e   D e v i l   s e n d s   t h e   b e a s t   w i t h   w r a t h   b e c a u s e   h e   k n o w s   t h e   t i m e   i s   s h o r t .   L e t   h i m   w h o   h a t h   u n d e r s t a n d i n g   r e c k o n   t h e   n u m b e r   o f   t h e   b e a s t ,   f o r   i t   i s   a   h u m a n   n u m b e r ,   i t s   n u m b e r   i s   S i x   H u n d r e d   a n d   S i x t y - S i x .
index 4a8c500..f374faf 100644 (file)
@@ -7,16 +7,15 @@ Allocations, by type:
        -ASCIIFlatString = 30
        -FlatBuffer = 2
        -Concat = 0
-       -RopeBuffer = 0
 
 Calls to length, by type:
        FlatString = 19
 Indexed accesses, by type:
 Calls to byte_length for each type:
-       FlatString = 48
+       FlatString = 44
 Calls to position for each type:
 Calls to bytepos for each type:
-Calls to first_byte on FlatString 50
+Calls to first_byte on FlatString 48
 Calls to last_byte on FlatString 10
 Length of travel for index distribution:
 Byte length of the FlatStrings created:
diff --git a/tests/sav/test_to_upper_lower_buffer_alt1.res b/tests/sav/test_to_upper_lower_buffer_alt1.res
deleted file mode 100644 (file)
index e69de29..0000000
index a6f70bd..ba4bdc3 100644 (file)
@@ -1,12 +1,8 @@
-#alt1 import core::text::ropes
-#alt1 import core
-
 var trimtest = "   \t nono nono   \n \t"
 
 var subtrim = trimtest.substring(2,15)
 
 var buffertrimtest: Buffer = new FlatBuffer.from(trimtest)
-#alt1 buffertrimtest = new RopeBuffer.from(trimtest)
 
 print "resulttrim = {buffertrimtest.trim}"
 
@@ -17,7 +13,6 @@ print "thirdtrim = {subtrim.trim}"
 var emptytrim = "         \t  "
 
 var bufferemptytest: Buffer = new FlatBuffer.from(emptytrim)
-#alt1 bufferemptytest = new RopeBuffer.from(emptytrim)
 
 print "emptytrim = {emptytrim.trim}"
 
@@ -26,7 +21,6 @@ print "bufferemptytrim = {bufferemptytest.trim}"
 var onelettertrim = "    \n   d      \n\t  "
 
 var oneletterbuftest: Buffer = new FlatBuffer.from(onelettertrim)
-#alt1 oneletterbuftest = new RopeBuffer.from(onelettertrim)
 
 print "onelettertrim = {onelettertrim.trim}"
 
@@ -35,7 +29,6 @@ print "oneletterbuftest = {oneletterbuftest.trim}"
 var twolettertrim = "    \n   hg      \n\t  "
 
 var twoletterbuftest: Buffer = new FlatBuffer.from(twolettertrim)
-#alt1 twoletterbuftest = new RopeBuffer.from(twolettertrim)
 
 print "twolettertrim = {twolettertrim.trim}"
 
@@ -44,7 +37,6 @@ print "twoletterbuftest = {twoletterbuftest.trim}"
 var firstlettertrim = "d                "
 
 var firstlettertrimbuf: Buffer = new FlatBuffer.from(firstlettertrim)
-#alt1 firstlettertrimbuf = new RopeBuffer.from(firstlettertrim)
 
 print "firstlettertrimtest = {firstlettertrim.trim}"
 
@@ -53,7 +45,6 @@ print "firstlettertrimbuftest = {firstlettertrimbuf.trim}"
 var lastlettertrim = "                     d"
 
 var lastlettertrimbuf: Buffer = new FlatBuffer.from(lastlettertrim)
-#alt1 lastlettertrimbuf = new RopeBuffer.from(lastlettertrim)
 
 print "lastlettertrimtest = {lastlettertrim.trim}"
 
index 902993a..c42de6d 100644 (file)
@@ -12,8 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-var fb: Buffer = new RopeBuffer
-#alt1 fb = new FlatBuffer
+var fb = new FlatBuffer
 
 for i in [0 .. 64[ do fb.add 'A'
 
diff --git a/tests/test_ropebuffer.nit b/tests/test_ropebuffer.nit
deleted file mode 100644 (file)
index aa21a5e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-var rb = new RopeBuffer
-
-for i in [0 .. 1000000[ do
-       rb.add 'S'
-       var s = rb.to_s
-end
diff --git a/tests/test_ropes_buffer_add_overflow.nit b/tests/test_ropes_buffer_add_overflow.nit
deleted file mode 100644 (file)
index b2592a1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Checks that `RopeBuffer.add` does not makes the internal buffer overflow.
-#
-# Note: In order to help repoducibility, this test read an private attribute of
-# the buffer.
-module test_ropes_buffer_add_overflow
-
-import core
-intrude import core::text::ropes
-
-var buffer = new RopeBuffer
-
-buffer.append("x" * maxlen)
-buffer.add 'y'
-assert buffer.rpos <= maxlen else print "{buffer.rpos} > {maxlen}"
diff --git a/tests/test_ropes_buffer_clear.nit b/tests/test_ropes_buffer_clear.nit
deleted file mode 100644 (file)
index 4293f8b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Checks if `RopeBuffer.clear` actually reset everything.
-module test_ropes_buffer_clear
-
-import core
-
-var buffer = new RopeBuffer
-
-buffer.append "1"
-# Force to flush the internal buffer, so that all the internal positions will be
-# set to a non-zero value.
-buffer.append("?" * (maxlen + 1))
-buffer.clear
-buffer.append "23"
-print buffer
-
-buffer = new RopeBuffer
-buffer.append "12"
-# Force to flush the internal buffer, so that all the internal positions will be
-# set to a non-zero value.
-buffer.append("?" * (maxlen + 1))
-buffer.clear
-buffer.append "3"
-print buffer
diff --git a/tests/test_ropes_buffer_reverse.nit b/tests/test_ropes_buffer_reverse.nit
deleted file mode 100644 (file)
index 1d8033c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-module test_ropes_buffer_reverse
-
-import core
-
-redef fun maxlen do return 3
-
-var buffer = new RopeBuffer
-
-buffer.reverse
-print "/{buffer}/"
-
-buffer.append("x" * (maxlen + 1))
-buffer.add 'y'
-buffer.reverse
-print buffer.to_s
diff --git a/tests/test_ropes_buffer_to_s.nit b/tests/test_ropes_buffer_to_s.nit
deleted file mode 100644 (file)
index 6078961..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Checks the immutability of the strings returned by `RopeBuffer.to_s`.
-module test_ropes_buffer_to_s
-
-import core
-
-# Note: In this sort of test, never print the string more than once: the string
-# itself may cache an flatten representation of itself when `print` calls `to_s`
-# on it. For example, the original bug that motivated the writting of the
-# present test got unoticed until we tried to edit the buffer **before**
-# outputting `s`.
-
-var buffer = new RopeBuffer
-var s: String
-
-sys.stdout.write "`clear` and `append`: "
-buffer.append "abcd"
-s = buffer.to_s
-buffer.clear
-buffer.append "ef"
-print s
-
-sys.stdout.write "`clear` and `add`: "
-buffer.clear
-buffer.add 'a'
-buffer.add 'b'
-s = buffer.to_s
-buffer.clear
-buffer.add 'c'
-print s
-
-sys.stdout.write "`add` at `maxlen + 1`: "
-buffer.clear
-buffer.add 'c'
-s = buffer.to_s
-buffer.append("*" * (maxlen -1))
-buffer.add 'x'
-print s
-
-sys.stdout.write "`append` up to `maxlen + 1`: "
-buffer.clear
-buffer.append "ab"
-s = buffer.to_s
-buffer.append("*" * (maxlen -1))
-print s
-
-sys.stdout.write "`reverse`: "
-buffer.clear
-buffer.append "xyz"
-s = buffer.to_s
-buffer.reverse
-print s
-
-sys.stdout.write "`upper`: "
-buffer.clear
-buffer.append "foo"
-s = buffer.to_s
-buffer.upper
-print s
-
-sys.stdout.write "`lower`: "
-buffer.clear
-buffer.append "BAR"
-s = buffer.to_s
-buffer.lower
-print s
index 13048d8..00d3d04 100644 (file)
@@ -30,8 +30,3 @@ var b = new FlatBuffer.from(x)
 
 print b.bytes.to_a
 print b.bytes.reverse_iterator.to_a
-
-var c = new RopeBuffer.from(x)
-
-print c.bytes
-print c.bytes.reverse_iterator.to_a
index 95f8dc7..2e03070 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import core
-#alt1 import core::text::ropes
-
 var s = "Bonjour !\n"
 var r: Buffer = new FlatBuffer.with_capacity(50)
-#alt1 r = new RopeBuffer
 var r2: Buffer = new FlatBuffer
-#alt1 r2 = new RopeBuffer
 
 var i = 0
 while i < 1000 do
index 820b5c3..2d636fb 100644 (file)
@@ -32,12 +32,6 @@ num = numstr
 #alt1 trimable.append(spaces)
 #alt1 num = new FlatBuffer.from(numstr)
 
-#alt3 txt = new RopeBuffer.from(str)
-#alt3 trimable = new RopeBuffer.from(spaces)
-#alt3 trimable.append(str)
-#alt3 trimable.append(spaces)
-#alt3 num = new RopeBuffer.from(numstr)
-
 # Test Text methods on all types of receivers
 
 print txt.substring(0, 105)
index b821db4..0c811be 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import core::text::ropes
-
 var x: Buffer = new FlatBuffer.from("test")
-#alt1 x = new RopeBuffer.from("test")
 var y: Buffer = new FlatBuffer.from("TEST")
-#alt1 y = new RopeBuffer.from("TEST")
 
 x.upper
 y.lower