Page MenuHomePhabricator

D9134.id21696.diff
No OneTemporary

D9134.id21696.diff

diff --git a/src/parser/aast/api/AASTNode.php b/src/parser/aast/api/AASTNode.php
--- a/src/parser/aast/api/AASTNode.php
+++ b/src/parser/aast/api/AASTNode.php
@@ -151,16 +151,21 @@
}
public function selectDescendantsOfType($type_name) {
- $type = $this->getTypeIDFromTypeName($type_name);
+ return $this->selectDescendantsOfTypes(array($type_name));
+ }
+
+ public function selectDescendantsOfTypes(array $type_names) {
+ $nodes = array();
+ foreach ($type_names as $type_name) {
+ $type = $this->getTypeIDFromTypeName($type_name);
- if (isset($this->selectCache)) {
- if (isset($this->selectCache[$type])) {
- $nodes = $this->selectCache[$type];
+ if (isset($this->selectCache)) {
+ if (isset($this->selectCache[$type])) {
+ $nodes = $nodes + $this->selectCache[$type];
+ }
} else {
- $nodes = array();
+ $nodes = $nodes + $this->executeSelectDescendantsOfType($this, $type);
}
- } else {
- $nodes = $this->executeSelectDescendantsOfType($this, $type);
}
return AASTNodeList::newFromTreeAndNodes($this->tree, $nodes);

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 17, 1:16 AM (5 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707913
Default Alt Text
D9134.id21696.diff (1 KB)

Event Timeline