From d71adb3df9b545d81b6e8cc13d4259de7b402ac9 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Thu, 15 Oct 2015 13:39:03 -0400 Subject: [PATCH] core/text: make FlatText private Signed-off-by: Alexandre Terrasa --- lib/core/text/abstract_text.nit | 6 +++--- lib/core/text/flat.nit | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/core/text/abstract_text.nit b/lib/core/text/abstract_text.nit index 01d0eab..baf8ae7 100644 --- a/lib/core/text/abstract_text.nit +++ b/lib/core/text/abstract_text.nit @@ -966,14 +966,14 @@ abstract class Text end # All kinds of array-based text representations. -abstract class FlatText +private abstract class FlatText super Text # Underlying C-String (`char*`) # # Warning : Might be void in some subclasses, be sure to check # if set before using it. - private var items: NativeString is noinit + var items: NativeString is noinit # Returns a char* starting at position `first_byte` # @@ -990,7 +990,7 @@ abstract class FlatText # # As always, do not modify the content of the String in C code, if this is what you want # copy locally the char* as Nit Strings are immutable. - private fun fast_cstring: NativeString is abstract + fun fast_cstring: NativeString is abstract redef var length = 0 diff --git a/lib/core/text/flat.nit b/lib/core/text/flat.nit index 5bc76fc..e8a2d4f 100644 --- a/lib/core/text/flat.nit +++ b/lib/core/text/flat.nit @@ -36,18 +36,18 @@ end redef class FlatText - private fun first_byte: Int do return 0 + fun first_byte: Int do return 0 - private fun last_byte: Int do return _bytelen - 1 + fun last_byte: Int do return _bytelen - 1 # Cache of the latest position (char) explored in the string - private var position: Int = 0 + var position: Int = 0 # Cached position (bytes) in the NativeString underlying the String - private var bytepos: Int = 0 + var bytepos: Int = 0 # Index of the character `index` in `_items` - private fun char_to_byte_index(index: Int): Int do + fun char_to_byte_index(index: Int): Int do var ln = length assert index >= 0 assert index < ln @@ -90,7 +90,7 @@ redef class FlatText # This enables a double-optimization in `escape_to_c` since if this # method returns 0, then `self` does not need escaping and can be # returned as-is - protected fun chars_to_escape_to_c: Int do + fun chars_to_escape_to_c: Int do var its = _items var max = last_byte var pos = first_byte -- 1.7.9.5