Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15394829
D9134.id21696.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9134.id21696.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9134: Add an `selectDescendantsOfTypes` to the `AASTNode`.
Attached
Detach File
Event Timeline
Log In to Comment