mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
QL: Fix up parent-child relation in tree
This commit is contained in:
@@ -79,6 +79,7 @@ class AstNode extends TAstNode {
|
||||
|
||||
/** Gets an annotation of this AST node. */
|
||||
Annotation getAnAnnotation() {
|
||||
not this instanceof Annotation and // avoid cyclic parent-child relationship
|
||||
toQL(this).getParent() = pragma[only_bind_out](toQL(result)).getParent()
|
||||
}
|
||||
|
||||
@@ -125,6 +126,9 @@ class TopLevel extends TTopLevel, AstNode {
|
||||
/** Gets a `newtype` defined at the top-level of this module. */
|
||||
NewType getANewType() { result = this.getAMember() }
|
||||
|
||||
/** Gets a `select` clause in the top-level of this module. */
|
||||
Select getASelect() { result = this.getAMember() }
|
||||
|
||||
override ModuleMember getAChild(string pred) {
|
||||
pred = directMember("getAnImport") and result = this.getAnImport()
|
||||
or
|
||||
@@ -137,6 +141,8 @@ class TopLevel extends TTopLevel, AstNode {
|
||||
pred = directMember("getANewType") and result = this.getANewType()
|
||||
or
|
||||
pred = directMember("getQLDoc") and result = this.getQLDoc()
|
||||
or
|
||||
pred = directMember("getASelect") and result = this.getASelect()
|
||||
}
|
||||
|
||||
QLDoc getQLDocFor(ModuleMember m) {
|
||||
|
||||
Reference in New Issue
Block a user