Skip to content

Commit a8ba4b1

Browse files
committed
Switch QRegex::Cursor to NQPCursorRole and export it.
1 parent 69aa482 commit a8ba4b1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/QRegex/Cursor.nqp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
role QRegex::Cursor {
1+
role NQPCursorRole {
22
has $!orig;
33
has str $!target;
44
has int $!from;
@@ -263,11 +263,17 @@ class NQPMatch is NQPCapture {
263263
}
264264
}
265265

266-
class NQPCursor does QRegex::Cursor {
266+
class NQPCursor does NQPCursorRole {
267267
method match_class() { NQPMatch }
268268
method Bool() is parrot_vtable('get_bool') {
269269
!nqp::isnull(nqp::getattr(self, $?CLASS, '$!match'))
270270
&& nqp::istrue(nqp::getattr(self, $?CLASS, '$!match'));
271271
}
272272
}
273273

274+
275+
my module EXPORT {
276+
our module DEFAULT {
277+
$?PACKAGE.WHO<NQPCursorRole> := NQPCursorRole;
278+
}
279+
}

0 commit comments

Comments
 (0)