mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
add type arguments of ModuleInstation to the pretty AST
This commit is contained in:
@@ -2217,6 +2217,20 @@ class ModuleExpr extends TModuleExpr, ModuleRef {
|
||||
result = super.getAChild(pred)
|
||||
or
|
||||
pred = directMember("getQualifier") and result = this.getQualifier()
|
||||
or
|
||||
exists(int i | pred = indexedMember("getArgument", i) and result = this.getArgument(i))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `i`th type argument if this module is a module instantiation.
|
||||
* The result is either a `PredicateExpr` or a `TypeExpr`.
|
||||
*/
|
||||
AstNode getArgument(int i) {
|
||||
exists(QL::ModuleInstantiation instantiation | instantiation.getParent() = me |
|
||||
toQL(result) = instantiation.getChild(i).getPredicate()
|
||||
or
|
||||
toQL(result) = instantiation.getChild(i).getTypeExpr()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user