mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
Don't traverse nodes merged by another visitor
If a NodeVisitor returns an array of nodes to merge these will no longer be traversed by all other visitors. That "feature" turned out to be a real pain in the ass on some occasions ;)
This commit is contained in:
parent
6657ac4b76
commit
2ed6cac7c1
@ -98,12 +98,6 @@ class PHPParser_NodeTraverser
|
||||
$doNodes[] = array($i, array());
|
||||
break;
|
||||
} elseif (is_array($return)) {
|
||||
// traverse replacement nodes using all visitors apart from the one that
|
||||
// did the change
|
||||
unset($this->visitors[$j]);
|
||||
$return = $this->traverseArray($return);
|
||||
$this->visitors[$j] = $visitor;
|
||||
|
||||
$doNodes[] = array($i, $return);
|
||||
break;
|
||||
} elseif (null !== $return) {
|
||||
|
Loading…
Reference in New Issue
Block a user