commit 5144db2d76c95a3b2538bb3333b04efa167423d0
parent 43f098bf0d7a4281e65be7967dc5175fafcf9497
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Tue, 1 Oct 2024 18:03:28 +0200
hare::module: Highlight results from gather*() calls
Dummy submodule placeholders and dependencies don't qualify.
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/hare/module/deps.ha b/hare/module/deps.ha
@@ -108,6 +108,12 @@ fn get_deps(cachedir: str, srcs: *srcset) ([]ast::ident | error) = {
return deps;
};
+// Returns true if a module was requested via [[gather_submodules]] or
+// [[gather]], and not resolved as a collateral.
+export fn gathered(mod: *module) bool = {
+ return !mod.is_dep && (len(mod.srcs.ha) > 0 || len(mod.srcs.s) > 0);
+};
+
// Gather a [[module]] and by default all its dependencies, appending them to
// an existing slice, deduplicated, in reverse topological order, returning the
// index of the input module within the slice. Dependencies will also be written