Handbook
Glossary
run-captures ( start end string table registers -- registers/f )
Vocabulary
regexp
.
captures
.
private
Inputs
start
an
object
end
an
object
string
an
object
table
an
object
registers
an
object
Outputs
registers/f
an
object
Definition
USING:
accessors
kernel
math
sequences
vectors
;
IN:
regexp.captures.private
::
run-captures
( start end string table registers -- registers/f )
table
start-state>>
registers
capture-thread
boa
1vector
:>
seeds! start
:>
position!
f
:>
result!
[
position end
<=
seeds
empty?
not
and
]
[
seeds position string table
capture-closure
:>
ready position end
=
[
ready
[
pc>>
not
]
find
nip
[
registers>>
result!
]
when*
V{
}
clone
seeds!
]
[
ready position string
nth
advance-captures
seeds!
]
if
position 1
+
position!
]
while
result
;