Skip to content

Commit

Permalink
Fix stupid bug with process_recursive.
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek authored and Reini Urban committed Oct 2, 2012
1 parent 3d3ec36 commit dfe41e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compilers/opsc/src/Ops/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ sub process_recursive($op, &ctor) {
pir::push($res, process_recursive($_, &ctor)) for @($op);
$res{$_} := process_recursive($op{$_}, &ctor) for $op.hash.keys;
}
elsif (pir::does($res, 'array')) {
$res := $res.map(->$_ { process_recursive($_, &ctor) });
elsif pir::does($op, 'array') {
$res := $op.map(->$_ { process_recursive($_, &ctor) });
}
else {
$res := pir::clone($op);
Expand All @@ -40,6 +40,7 @@ sub to_capture($op) {
my $what := ~$_.WHAT;
$_ := pir::new('Capture');
$_<WHAT> := $what;
$_.hash.delete('source');
$_
});
}
Expand Down

0 comments on commit dfe41e3

Please sign in to comment.