Handbook
Glossary
number-captures ( ast -- ast' )
Vocabulary
regexp
.
captures
.
private
Inputs
ast
an
object
Outputs
ast'
an
object
Definition
IN:
regexp.captures.private
GENERIC:
number-captures
( ast -- ast' )
Methods
USING:
accessors
kernel
regexp.ast
regexp.captures.private
;
M:
alternation
number-captures
[
first>>
number-captures
]
[
second>>
number-captures
]
bi
alternation
boa
;
USING:
accessors
assocs
kernel
math
namespaces
regexp.ast
regexp.captures
regexp.captures.private
sequences
;
M::
capture-group
number-captures
( ast -- ast' )
capture-number
get
first
1
+
:>
index index 0
capture-number
get
set-nth
ast
name>>
:>
name name
[
name
capture-names
get
key?
[
name
duplicate-capture-name
]
when
index name
capture-names
get
set-at
]
when
ast
term>>
number-captures
captures-enabled?
get
[
name index
numbered-capture
boa
]
when
;
USING:
accessors
kernel
regexp.ast
regexp.captures.private
;
M:
concatenation
number-captures
[
first>>
number-captures
]
[
second>>
number-captures
]
bi
concatenation
boa
;
USING:
accessors
kernel
namespaces
regexp.ast
regexp.captures.private
;
M:
lookahead
number-captures
term>>
number-captures
captures-enabled?
get
[
capturing-lookahead
boa
]
[
<lookahead>
]
if
;
USING:
accessors
kernel
namespaces
regexp.ast
regexp.captures.private
;
M:
lookbehind
number-captures
term>>
number-captures
captures-enabled?
get
[
capturing-lookbehind
boa
]
[
<lookbehind>
]
if
;
USING:
accessors
namespaces
regexp.ast
regexp.captures.private
;
M:
negation
number-captures
f
captures-enabled?
[
term>>
number-captures
<negation>
]
with-variable
;
USING:
accessors
namespaces
regexp.captures.private
regexp.classes
;
M:
not-class
number-captures
f
captures-enabled?
[
class>>
number-captures
<not-class>
]
with-variable
;
USING:
kernel
regexp.captures.private
;
M:
object
number-captures
;
USING:
accessors
kernel
regexp.ast
regexp.captures.private
;
M:
repeated
number-captures
[
term>>
number-captures
]
[
times>>
]
bi
<repeated>
;
USING:
accessors
regexp.ast
regexp.captures.private
;
M:
star
number-captures
term>>
number-captures
<star>
;
USING:
accessors
regexp.ast
regexp.captures.private
;
M:
tagged-epsilon
number-captures
tag>>
number-captures
<tagged-epsilon>
;
USING:
accessors
kernel
regexp.ast
regexp.captures.private
;
M:
with-options
number-captures
[
tree>>
number-captures
]
[
options>>
]
bi
<with-options>
;