hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 04a06a4e38a9b58aca3b99b912e6ca3a84c38268
parent 07d575be5f820ea9870be8a6cdb25e760fc13df5
Author: Autumn! <autumnull@posteo.net>
Date:   Fri,  3 Mar 2023 13:16:55 +0000

Add graphviz dotfile output to deps

Signed-off-by: Autumn! <autumnull@posteo.net>

Diffstat:
Mcmd/hare/subcmds.ha | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cmd/hare/subcmds.ha b/cmd/hare/subcmds.ha @@ -323,7 +323,14 @@ fn deps(args: []str) void = { case deps_goal::TERM => show_deps(&visited); case deps_goal::DOT => - abort("-d option not implemented yet"); + fmt::println("strict digraph deps {")!; + for (let i = 0z; i < len(visited); i += 1) { + for (let j = 0z; j < len(visited[i].depends); j += 1) { + const child = visited[visited[i].depends[j]]; + fmt::printfln("\t\"{}\" -> \"{}\";", visited[i].ident, child.ident)!; + }; + }; + fmt::println("}")!; case deps_goal::MAKE => abort("-M option not implemented yet"); };