Skip to content

Commit

Permalink
Pass the match result into the transformation for :when passes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcurtis committed Jul 31, 2010
1 parent 68344b1 commit 97d95b0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Tree/Optimizer/Pass.nqp
Expand Up @@ -29,9 +29,14 @@ method BUILD (:$transformation, :$name, :$when, *%ignored) {
}

method run ($tree) {
if !pir::defined__IPP($!when) || $tree ~~ $!when {
$!transformation($tree);
if pir::defined__IPP($!when) {
my $/ := $tree ~~ $!when;
if $/ {
$!transformation($/);
} else {
$tree;
}
} else {
$tree;
$!transformation($tree);
}
}

0 comments on commit 97d95b0

Please sign in to comment.