mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-09-05 05:02:30 +00:00
Beginning deserialization of data
This commit is contained in:
@@ -31,6 +31,7 @@ module BytesRegex
|
||||
end
|
||||
|
||||
def match(str : Bytes, pos = 0) : Array(Match)
|
||||
match = [] of Match
|
||||
rc = LibPCRE2.match(
|
||||
@re,
|
||||
str,
|
||||
@@ -39,9 +40,9 @@ module BytesRegex
|
||||
LibPCRE2::NO_UTF_CHECK,
|
||||
@match_data,
|
||||
nil)
|
||||
if rc > 0
|
||||
if rc >= 0
|
||||
ovector = LibPCRE2.get_ovector_pointer(@match_data)
|
||||
(0...rc).map do |i|
|
||||
(0...rc).each do |i|
|
||||
m_start = ovector[2 * i]
|
||||
m_end = ovector[2 * i + 1]
|
||||
if m_start == m_end
|
||||
@@ -54,6 +55,7 @@ module BytesRegex
|
||||
else
|
||||
[] of Match
|
||||
end
|
||||
match
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user