Skip to content

Commit 9b0b4df

Browse files
authored
Add getAModule and getANewType
Also removes `getAQLDocComment`, as those were already dangling off of their respective successors in the file (and so should not dangle off of the top level as well).
1 parent 3280f02 commit 9b0b4df

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

ql/src/codeql_ql/ast/Ast.qll

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,24 @@ class TopLevel extends TTopLevel, AstNode {
8484
/** Gets a top-level predicate in this module. */
8585
ClasslessPredicate getAPredicate() { result = this.getAMember() }
8686

87-
/**
88-
* Gets a QLDoc comment for a top-level entity in this module.
89-
*
90-
* Use `getQLDoc` if you want the QLDoc for the module itself.
91-
*/
92-
QLDoc getAQLDocComment() { result = getQLDocFor(_) }
93-
94-
/** Gets a module defined at the top-level module of this module. */
87+
/** Gets a module defined at the top-level of this module. */
9588
Module getAModule() { result = this.getAMember() }
9689

90+
/** Gets a `newtype` defined at the top-level of this module. */
91+
NewType getANewType() { result = this.getAMember() }
92+
9793
override ModuleMember getAChild(string pred) {
98-
pred = directMember("getAQLDocComment") and result = this.getAQLDocComment()
99-
or
10094
pred = directMember("getQLDoc") and result = this.getQLDoc()
10195
or
10296
pred = directMember("getAnImport") and result = this.getAnImport()
10397
or
10498
pred = directMember("getAClass") and result = this.getAClass()
10599
or
106100
pred = directMember("getAPredicate") and result = this.getAPredicate()
101+
or
102+
pred = directMember("getAModule") and result = this.getAModule()
103+
or
104+
pred = directMember("getANewType") and result = this.getANewType()
107105
}
108106

109107
QLDoc getQLDocFor(ModuleMember m) {

0 commit comments

Comments
 (0)