Skip to content

Commit

Permalink
Properly create Regex method closures. Remove unneeded 'clone' step f…
Browse files Browse the repository at this point in the history
…rom Role.pm.
  • Loading branch information
pmichaud committed Jul 4, 2010
1 parent 0ba07fa commit 7b6444c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Perl6/Actions.pm
Expand Up @@ -1436,7 +1436,7 @@ method regex_def($/, $key?) {

# Create code object and install it provided it has a name.
if ($name) {
my $code := create_code_object(PAST::Val.new(:value($past)), 'Regex', 0);
my $code := block_closure(blockref($past), 'Regex', 0);
our @PACKAGE;
unless +@PACKAGE {
$/.CURSOR.panic("Can not declare named " ~ ~$<sym> ~ " outside of a package");
Expand All @@ -1446,7 +1446,7 @@ method regex_def($/, $key?) {
install_method($/, $code, $name, %table);
}
else {
$past := create_code_object($past, 'Regex', 0);
$past := block_closure($past, 'Regex', 0);
}
}
make $past;
Expand Down
6 changes: 1 addition & 5 deletions src/Perl6/Compiler/Role.pm
Expand Up @@ -68,11 +68,7 @@ method finish($block) {
:pasttype('callmethod'),
:name('add_method'),
$meta_reg, $obj_reg, ~$_,
PAST::Op.new(
:pasttype('callmethod'),
:name('clone'),
%methods{~$_}<code_ref>
)
%methods{~$_}<code_ref>
));
}

Expand Down

0 comments on commit 7b6444c

Please sign in to comment.