Clean up to astNodes predicate to make more explicit

Co-authored-by: Chris Smowton <smowton@github.com>
This commit is contained in:
annarailton
2021-11-16 12:32:35 +00:00
parent 46958e5bff
commit 2b334055db

View File

@@ -423,15 +423,15 @@ module DatabaseFeatures {
}
query predicate astNodes(
Entity enclosingEntity, EntityOrAstNode parent, int index, AstNode node, string node_type
Entity enclosingEntity, EntityOrAstNode parent, int index, AstNode child, string childType
) {
node = enclosingEntity.getAstRoot(index) and
child = enclosingEntity.getAstRoot(index) and
parent = enclosingEntity and
node_type = node.getType()
childType = child.getType()
or
astNodes(enclosingEntity, _, _, parent, _) and
node = parent.(AstNode).getChild(index) and
node_type = node.getType()
child = parent.(AstNode).getChild(index) and
childType = child.getType()
}
query predicate nodeAttributes(AstNode node, string attr) {