lib/re: rename `optimize_is_in` to `optimize_has`
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 30 Aug 2015 13:34:37 +0000 (09:34 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 31 Aug 2015 04:05:21 +0000 (00:05 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/core/re.nit
lib/saxophonit/reader_model.nit

index 02e0b4f..99421f8 100644 (file)
@@ -153,11 +153,11 @@ class Regex
        # Ignore case when matching letters
        var ignore_case = false is writable
 
-       # Optimize `self` for `is_in` and `String::has`, but do not support searches
+       # Optimize `self` for `String::has` and `is_in`, but do not support searches
        #
        # If `true`, `self` cannont be used with `String::search_all`, `String::replace`
        # or `String::split`.
-       var optimize_is_in = false is writable
+       var optimize_has = false is writable
 
        # Treat a newline in string as dividing string into multiple lines
        #
@@ -208,7 +208,7 @@ class Regex
                var cflags = 0
                if extended then cflags |= flag_extended
                if ignore_case then cflags |= flag_icase
-               if optimize_is_in then cflags |= flag_nosub
+               if optimize_has then cflags |= flag_nosub
                if newline then cflags |= flag_newline
 
                var native = self.native
@@ -307,7 +307,7 @@ class Regex
                abort
        end
 
-       # require: not optimize_is_in
+       # require: not optimize_has
        #
        #     assert "l".to_re.search_index_in("hello world", 0) == 2
        #     assert "el+o".to_re.search_index_in("hello world", 0) == 1
@@ -315,7 +315,7 @@ class Regex
        #     assert "z".to_re.search_index_in("hello world", 0) == -1
        redef fun search_index_in(text, from)
        do
-               assert not optimize_is_in
+               assert not optimize_has
 
                var comp_res = compile
                assert comp_res == null else "Regex compilation failed with: {comp_res.message}\n".output
@@ -340,7 +340,7 @@ class Regex
                abort
        end
 
-       # require: not optimize_is_in
+       # require: not optimize_has
        #
        #     assert "l".to_re.search_in("hello world", 0).from == 2
        #     assert "el+o".to_re.search_in("hello world", 0).from == 1
@@ -348,7 +348,7 @@ class Regex
        #     assert "z".to_re.search_in("hello world", 0) == null
        redef fun search_in(text, from)
        do
-               assert not optimize_is_in
+               assert not optimize_has
 
                var comp_res = compile
                assert comp_res == null else "Regex compilation failed with: {comp_res.message}\n".output
@@ -393,13 +393,13 @@ class Regex
                abort
        end
 
-       # require: not optimize_is_in
+       # require: not optimize_has
        #
        #     assert "ab".to_re.search_all_in("abbab").join(", ") == "ab, ab"
        #     assert "b+".to_re.search_all_in("abbabaabbbbbcab").join(", ") == "bb, b, bbbbb, b"
        redef fun search_all_in(text)
        do
-               assert not optimize_is_in
+               assert not optimize_has
 
                var comp_res = compile
                assert comp_res == null else "Regex compilation failed with: {comp_res.message}\n".output
index a5e1365..6e9254e 100644 (file)
@@ -67,7 +67,7 @@ class XophonReaderModel
 
 
        init do
-               qname_re.optimize_is_in = true
+               qname_re.optimize_has = true
                features[feature_namespaces_uri] = true
                features[feature_namespace_prefixes_uri] = false
        end