Skip to content

Commit

Permalink
Add Tree::Optimizer::Pass.transformer-class method to simplify subcla…
Browse files Browse the repository at this point in the history
…ssing.
  • Loading branch information
tcurtis committed Aug 8, 2010
1 parent 2cc3e32 commit 34eb267
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Tree/Optimizer/Pass.nqp
Expand Up @@ -68,10 +68,14 @@ method run ($tree) {
}
}

method transformer-class () {
Tree::Optimizer::Transformer::Single;
}

method generate-transformer () {
if pir::defined__IP($!when) {
$!when.transformer_class.new($!when, $!transformation);
} else {
Tree::Optimizer::Transformer::Single.new($!transformation);
self.transformer-class.new($!transformation);
}
}

0 comments on commit 34eb267

Please sign in to comment.