Skip to content

Commit 9a65d79

Browse files
committed
Add an optional match argument to !cursor_pass, to let us explicitly specify the match to be used.
1 parent de3c519 commit 9a65d79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Regex/Cursor.pir

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,13 +645,16 @@ with a "real" Match object when requested.
645645
.sub '!cursor_pass' :method :subid('Regex_Cursor_meth_!cursor_pass') :outer('Regex_Cursor_Body')
646646
.param int pos
647647
.param string name
648+
.param pmc match :optional
649+
.param int has_match :opt_flag
648650

649651
.local pmc cur_class
650652
cur_class = find_lex '$?CLASS'
651653

652654
repr_bind_attr_int self, cur_class, '$!pos', pos
653-
.local pmc match
655+
if has_match goto have_match
654656
match = get_global '$!TRUE'
657+
have_match:
655658
setattribute self, cur_class, '$!match', match
656659
unless name goto done
657660
self.'!reduce'(name)

0 commit comments

Comments
 (0)