Python: sync with Python

This commit is contained in:
Asger F
2022-09-06 09:20:10 +02:00
parent 2cbba65617
commit c7c3ad29cd
2 changed files with 7 additions and 7 deletions

View File

@@ -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)
} }
/** /**

View File

@@ -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)
} }
/** /**