mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-28 18:32:07 +03:00
Add a function to compute a dependency tree
This commit is contained in:
parent
5987dbd1e9
commit
40146551a8
12
cryptol-remote-api/python/cryptol/file_deps.py
Normal file
12
cryptol-remote-api/python/cryptol/file_deps.py
Normal file
@ -0,0 +1,12 @@
|
||||
def nestedFileDeps(getDeps, name : str, isFile : bool) -> Any:
|
||||
done = {}
|
||||
start = getDeps(name, isFile)
|
||||
todo = start["imports"].copy()
|
||||
while len(todo) > 0:
|
||||
m = todo.pop()
|
||||
if m in done:
|
||||
continue
|
||||
deps = file_deps(m, False)
|
||||
todo.extend(deps["imports"])
|
||||
return (start, deps)
|
||||
|
Loading…
Reference in New Issue
Block a user