diff options
Diffstat (limited to 'examples/tomodeps/tomodeps.tm')
| -rw-r--r-- | examples/tomodeps/tomodeps.tm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/tomodeps/tomodeps.tm b/examples/tomodeps/tomodeps.tm index 1181f2be..1e6be615 100644 --- a/examples/tomodeps/tomodeps.tm +++ b/examples/tomodeps/tomodeps.tm @@ -16,7 +16,7 @@ func _get_file_dependencies(file:Path -> |Dependency|) say("Could not read file: $file") return || - deps : @|Dependency| = @|| + deps : @|Dependency| if lines := file.by_line() for line in lines if line.matches_pattern($Pat/use {..}.tm/) @@ -36,8 +36,8 @@ func _build_dependency_graph(dep:Dependency, dependencies:@{Dependency=|Dependen _get_file_dependencies(path) is Module(module) dir := (~/.local/share/tomo/installed/$module) - module_deps : @|Dependency| = @|| - visited : @|Path| = @|| + module_deps : @|Dependency| + visited : @|Path| unvisited := @|f.resolved() for f in dir.files() if f.extension() == ".tm"| while unvisited.length > 0 file := unvisited.items[-1] @@ -58,7 +58,7 @@ func _build_dependency_graph(dep:Dependency, dependencies:@{Dependency=|Dependen _build_dependency_graph(dep2, dependencies) func get_dependency_graph(dep:Dependency -> {Dependency=|Dependency|}) - graph : @{Dependency=|Dependency|} = @{} + graph : @{Dependency=|Dependency|} _build_dependency_graph(dep, graph) return graph @@ -88,7 +88,7 @@ func _draw_tree(dep:Dependency, dependencies:{Dependency=|Dependency|}, already_ _draw_tree(child, dependencies, already_printed, child_prefix, is_child_last) func draw_tree(dep:Dependency, dependencies:{Dependency=|Dependency|}) - printed : @|Dependency| = @|| + printed : @|Dependency| say(_printable_name(dep)) printed.add(dep) deps := dependencies[dep] or || |
