Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make the new :depends-on tests pass.

  • Loading branch information...
commit 4d67c12e7ffd328485561b4db57ffd47ba8e2a46 1 parent 25f33c2
tcurtis authored
Showing with 13 additions and 4 deletions.
  1. +13 −4 src/Tree/Optimizer.nqp
View
17 src/Tree/Optimizer.nqp
@@ -33,10 +33,19 @@ method find-pass ($name) {
}
method register ($transformation, *%adverbs) {
- my $pass :=
- ($transformation ~~ Tree::Optimizer::Pass
- ?? $transformation
- !! Tree::Optimizer::Pass.new($transformation, |%adverbs));
+ my $pass;
+ if $transformation ~~ Tree::Optimizer::Pass {
+ $pass := $transformation.clone;
+ if pir::exists__IQs(%adverbs, 'depends-on') {
+ if pir::isa__IPP(%adverbs<depends-on>, String) {
+ $pass.dependencies.push(%adverbs<depends-on>);
+ } else {
+ $pass.dependencies.append(%adverbs<depends-on>);
+ }
+ }
+ } else {
+ $pass := Tree::Optimizer::Pass.new($transformation, |%adverbs);
+ }
%!passes{$pass.name} := $pass;
for $pass.dependencies -> $dependency {
self.add-dependency($pass.name, $dependency);
Please sign in to comment.
Something went wrong with that request. Please try again.