lib/re: mark with FIXME problems with length computations
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 1 Sep 2015 14:43:50 +0000 (10:43 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 1 Sep 2015 14:43:50 +0000 (10:43 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/core/re.nit

index 33ab76c..c37bf25 100644 (file)
@@ -380,18 +380,18 @@ class Regex
                # Found one?
                if res == 0 then
                        var first_char = bstr.byte_to_char_index(native_match.rm_so)
-                       var last_char = bstr.byte_to_char_index(native_match.rm_eo - native_match.rm_so - 1)
+                       var length_char = bstr.byte_to_char_index(native_match.rm_eo - native_match.rm_so - 1) # FIXME For issue #1684
                        var match = new Match(text,
                                from + first_char,
-                               last_char + 1)
+                               length_char + 1)
 
                        # Add sub expressions
                        for i in [1 .. nsub] do
                                first_char = bstr.byte_to_char_index(native_match[i].rm_so)
-                               last_char = bstr.byte_to_char_index(native_match[i].rm_eo - native_match[i].rm_so - 1)
+                               length_char = bstr.byte_to_char_index(native_match[i].rm_eo - native_match[i].rm_so - 1) # FIXME For issue #1684
                                match.subs.add new Match( text,
                                        from + first_char,
-                                       last_char + 1)
+                                       length_char + 1)
                        end
 
                        return match