nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/re: mark with FIXME problems with length computations
[nit.git]
/
lib
/
core
/
re.nit
diff --git
a/lib/core/re.nit
b/lib/core/re.nit
index
33ab76c
..
c37bf25
100644
(file)
--- 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)
# 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,
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)
# 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,
match.subs.add new Match( text,
from + first_char,
- last_char + 1)
+ length_char + 1)
end
return match
end
return match