Skip to content

Commit

Permalink
Traverse vivibase with PAST::Walker.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/branches/gsoc_past_optimization@48032 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Tyler Curtis committed Jul 7, 2010
1 parent 458c9cd commit 7e2a621
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions runtime/parrot/library/PAST/Walker.nqp
Expand Up @@ -27,6 +27,7 @@ module Tree::Walker {
walk($walker, $var[$index++]);
}
walk($walker, $var.viviself) if $walker.walkable($var.viviself);
walk($walker, $var.vivibase) if $walker.walkable($var.vivibase);
}
}

Expand Down
4 changes: 3 additions & 1 deletion t/library/pastwalker.t
Expand Up @@ -52,7 +52,7 @@ Uses PAST::Walker::NodeCounter to count the number of each node type in a PAST.
is($P3, 3, "PAST::Block")

$P3 = $P2['ops']
is($P3, 3, "PAST::Op")
is($P3, 4, "PAST::Op")

$P3 = $P2['vars']
is($P3, 2, "PAST::Var")
Expand All @@ -72,6 +72,8 @@ Uses PAST::Walker::NodeCounter to count the number of each node type in a PAST.
past = new ['PAST';'Block']

$P0 = new ['PAST'; 'Var']
$P1 = new ['PAST'; 'Op']
$P0.'vivibase'($P1)
push past, $P0
$P0 = new ['PAST'; 'Op']
$P0.'pirop'("call")
Expand Down

0 comments on commit 7e2a621

Please sign in to comment.