diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-01-12 16:54:37 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-01-12 16:54:37 -0500 |
| commit | c60ea2079fb230213308904cd0966e5481d2d994 (patch) | |
| tree | 630bcb480bfcdd2dc4aec5ecb4a2f8d1daa6475a /examples/tomodeps | |
| parent | 645d66e0de0f201404d9ad4b210f90c139a247ff (diff) | |
Fix up examples
Diffstat (limited to 'examples/tomodeps')
| -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 1f42850b..3ff48f98 100644 --- a/examples/tomodeps/tomodeps.tm +++ b/examples/tomodeps/tomodeps.tm @@ -25,7 +25,7 @@ func _get_file_dependencies(file:Path -> {Dependency}): deps:add(Dependency.Module(module_name)) return deps[] -func _build_dependency_graph(dep:Dependency, dependencies:@{Dependency:{Dependency}}): +func _build_dependency_graph(dep:Dependency, dependencies:@{Dependency,{Dependency}}): return if dependencies:has(dep) dependencies[dep] = {:Dependency} # Placeholder @@ -55,8 +55,8 @@ func _build_dependency_graph(dep:Dependency, dependencies:@{Dependency:{Dependen for dep2 in dep_deps: _build_dependency_graph(dep2, dependencies) -func get_dependency_graph(dep:Dependency -> {Dependency:{Dependency}}): - graph := @{:Dependency:{Dependency}} +func get_dependency_graph(dep:Dependency -> {Dependency,{Dependency}}): + graph := @{:Dependency,{Dependency}} _build_dependency_graph(dep, graph) return graph @@ -70,7 +70,7 @@ func _printable_name(dep:Dependency -> Text): else: return "$(\x1b)[31;1m$(f.text_content) (not found)$(\x1b)[m" -func _draw_tree(dep:Dependency, dependencies:{Dependency:{Dependency}}, already_printed:@{Dependency}, prefix="", is_last=yes): +func _draw_tree(dep:Dependency, dependencies:{Dependency,{Dependency}}, already_printed:@{Dependency}, prefix="", is_last=yes): if already_printed:has(dep): say(prefix ++ (if is_last: "└── " else: "├── ") ++ _printable_name(dep) ++ " $\x1b[2m(recursive)$\x1b[m") return @@ -85,7 +85,7 @@ func _draw_tree(dep:Dependency, dependencies:{Dependency:{Dependency}}, already_ is_child_last := (i == children.length) _draw_tree(child, dependencies, already_printed, child_prefix, is_child_last) -func draw_tree(dep:Dependency, dependencies:{Dependency:{Dependency}}): +func draw_tree(dep:Dependency, dependencies:{Dependency,{Dependency}}): printed := @{:Dependency} say(_printable_name(dep)) printed:add(dep) |
