Skip to content

Commit

Permalink
Got it working, I think.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Leslie Curtis committed Jul 9, 2010
1 parent f03b2c2 commit 0c73ff9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/PAST/Transformer.nqp
Expand Up @@ -20,18 +20,22 @@ module Tree::Walker {
$results[$index] := walk($walker, $var[$index]);
$index++;
}
$results['viviself'] := $walker.walk($var.viviself)
$results<viviself> := $walker.walk($var.viviself)
if $walker.walkable($var.viviself);
$results['vivibase'] := $walker.walk($var.vivibase)
$results<vivibase> := $walker.walk($var.vivibase)
if $walker.walkable($var.vivibase);
$results;
}

our multi sub replaceChildren (PAST::Var $node, $newChildren) {
$node := null;
our multi sub replaceChildren (PAST::Var $node, Capture $newChildren) {
for $node.list {
pir::pop($node);
}
for $newChildren.list -> $child {
pir::push($node, $child);
}
pir::delete($node, 'viviself');
pir::delete($node, 'vivibase');
for $newChildren.hash {
$node.attr($_.key, $_.value, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Tree/Transformer.nqp
Expand Up @@ -35,7 +35,7 @@ module Tree::Walker {
@results;
}

our sub replaceChildren ($node, $newChildren) {
our multi sub replaceChildren ($node, $newChildren) {
my $index := pir::elements__IP($node);
while ($index > 0) {
pir::pop__PP($node);
Expand Down

0 comments on commit 0c73ff9

Please sign in to comment.