From 030b52247a2060f160ae020816fabe8536b7f4ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 1 Sep 2015 10:43:50 -0400 Subject: [PATCH] lib/re: mark with FIXME problems with length computations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/core/re.nit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/re.nit b/lib/core/re.nit index 33ab76c..c37bf25 100644 --- a/lib/core/re.nit +++ b/lib/core/re.nit @@ -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 -- 1.7.9.5