Skip to content
Browse files

Make Tree::Optimizer::Pass options to Tree::Optimizer.register work.

  • Loading branch information...
1 parent e36f8c9 commit 231e92033cabce8a38054cf014696c40af20c17e tcurtis committed Aug 6, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Tree/Optimizer.nqp
View
5 src/Tree/Optimizer.nqp
@@ -33,7 +33,10 @@ method find-pass ($name) {
}
method register ($transformation, *%adverbs) {
- my $pass := Tree::Optimizer::Pass.new($transformation, |%adverbs);
+ my $pass :=
+ ($transformation ~~ Tree::Optimizer::Pass
+ ?? $transformation
+ !! Tree::Optimizer::Pass.new($transformation, |%adverbs));
%!passes{$pass.name} := $pass;
for $pass.dependencies -> $dependency {
self.add-dependency($pass.name, $dependency);

0 comments on commit 231e920

Please sign in to comment.
Something went wrong with that request. Please try again.