mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: sync with Python
This commit is contained in:
@@ -427,15 +427,14 @@ pragma[nomagic]
|
|||||||
private API::Node getNodeFromType(string package, string type) {
|
private API::Node getNodeFromType(string package, string type) {
|
||||||
exists(string package2, string type2, AccessPath path2 |
|
exists(string package2, string type2, AccessPath path2 |
|
||||||
typeModel(package, type, package2, type2, path2) and
|
typeModel(package, type, package2, type2, path2) and
|
||||||
result = getNodeFromPath(package2, type2, path2, path2.getNumToken())
|
result = getNodeFromPath(package2, type2, path2)
|
||||||
)
|
)
|
||||||
or
|
or
|
||||||
result = any(TypeModelUseEntry e).getNodeForType(package, type)
|
result = any(TypeModelUseEntry e).getNodeForType(package, type)
|
||||||
or
|
or
|
||||||
result = any(TypeModelDefEntry e).getNodeForType(package, type)
|
result = any(TypeModelDefEntry e).getNodeForType(package, type)
|
||||||
or
|
or
|
||||||
isRelevantFullPath(package, type, _) and
|
result = Specific::getExtraNodeFromType(package, type)
|
||||||
result = Specific::getExtraNodeFromPath(package, type, _, 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,11 +40,12 @@ predicate isPackageUsed(string package) { exists(API::moduleImport(package)) }
|
|||||||
|
|
||||||
/** Gets a Python-specific interpretation of the `(package, type, path)` tuple after resolving the first `n` access path tokens. */
|
/** Gets a Python-specific interpretation of the `(package, type, path)` tuple after resolving the first `n` access path tokens. */
|
||||||
bindingset[package, type, path]
|
bindingset[package, type, path]
|
||||||
API::Node getExtraNodeFromPath(string package, string type, AccessPath path, int n) {
|
API::Node getExtraNodeFromPath(string package, string type, AccessPath path, int n) { none() }
|
||||||
|
|
||||||
|
/** Gets a Python-specific interpretation of the `(package, type)` tuple. */
|
||||||
|
API::Node getExtraNodeFromType(string package, string type) {
|
||||||
type = "" and
|
type = "" and
|
||||||
n = 0 and
|
result = API::moduleImport(package)
|
||||||
result = API::moduleImport(package) and
|
|
||||||
exists(path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user