Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15487094
D13819.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
554 B
Referenced Files
None
Subscribers
None
D13819.id.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
@@ -180,6 +180,16 @@
return $tokens;
}
+ final public function isDescendantOf(AASTNode $node) {
+ for ($it = $this; $it !== null; $it = $it->getParentNode()) {
+ if ($it === $node) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public function selectDescendantsOfType($type_name) {
return $this->selectDescendantsOfTypes(array($type_name));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 11, 11:13 AM (6 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7529840
Default Alt Text
D13819.id.diff (554 B)
Attached To
Mode
D13819: Add a method to query whether an AASTNode is a descendent of another node
Attached
Detach File
Event Timeline
Log In to Comment