[svn:parrot] r47936 - branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern
tcurtis at svn.parrot.org
tcurtis at svn.parrot.org
Wed Jun 30 07:04:43 UTC 2010
Author: tcurtis
Date: Wed Jun 30 07:04:42 2010
New Revision: 47936
URL: https://trac.parrot.org/parrot/changeset/47936
Log:
Make :descend_until and :min_depth work together.
Modified:
branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/Transformer.nqp
Modified: branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/Transformer.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/Transformer.nqp Wed Jun 30 07:00:41 2010 (r47935)
+++ branches/gsoc_past_optimization/runtime/parrot/library/Tree/Pattern/Transformer.nqp Wed Jun 30 07:04:42 2010 (r47936)
@@ -89,7 +89,8 @@
Capture $node) {
my $pattern := $walker.pattern();
my $shouldTransform;
- if ($walker.depth < $walker.min_depth) {
+ my $belowMinDepth := $walker.depth < $walker.min_depth;
+ if ($belowMinDepth) {
$shouldTransform := 0;
}
elsif ($pattern ~~ Tree::Pattern) {
@@ -107,7 +108,7 @@
}
my $shouldDescend;
- if (!pir::defined__IP($walker.descend_until)) {
+ if ($belowMinDepth || !pir::defined__IP($walker.descend_until)) {
$shouldDescend := 1;
}
elsif ($walker.descend_until ~~ Tree::Pattern) {
More information about the parrot-commits
mailing list