Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some missing methods in NQPRegex.
  • Loading branch information
jnthn committed Oct 21, 2012
1 parent deb59ee commit f8df485
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/core/NQPRoutine.pm
Expand Up @@ -35,7 +35,7 @@ my knowhow NQPRoutine {
# Clone and attach the code object.
my $der := pir::repr_clone__PP(self);
nqp::bindattr($der, NQPRoutine, '$!do', $do);
pir::set_sub_code_object__vPP($do, $der);
nqp::setcodeobj($do, $der);

# If needed, arrange for a fixup of the cloned code-ref.
my $clone_callback := pir::getprop__PPs($!do, 'CLONE_CALLBACK');
Expand Down Expand Up @@ -84,6 +84,26 @@ my knowhow NQPRegex {
method ALT_NFA(str $name) {
nqp::isnull(%!alt_nfas) ?? nqp::null() !! %!alt_nfas{$name}
}
method clone() {
# Clone the underlying VM code ref.
my $do := nqp::clone($!do);

# Clone and attach the code object.
my $der := pir::repr_clone__PP(self);
nqp::bindattr($der, NQPRegex, '$!do', $do);
nqp::setcodeobj($do, $der);

# If needed, arrange for a fixup of the cloned code-ref.
my $clone_callback := pir::getprop__PPs($!do, 'CLONE_CALLBACK');
if nqp::defined($clone_callback) {
$clone_callback($!do, $do, $der);
}

$der
}
method !set_name($name) {
pir::assign__0Ps($!do, $name);
}
}
pir::stable_publish_vtable_handler_mapping__vPP(NQPRegex,
nqp::hash(
Expand Down

0 comments on commit f8df485

Please sign in to comment.