hare

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

commit fce4379f46d7b5e1d941d8828c45339da73ea176
parent 5c2ef9d4be5631c0ed772076d4364fd9cf74e75d
Author: Alexey Yerin <yyp@disroot.org>
Date:   Mon,  2 May 2022 22:53:48 +0300

cmd/hare: error out if module has no input files

Previously this went up to harec, which printed a usage message since
it didn't get enough arguments.

Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mcmd/hare/schedule.ha | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha @@ -246,12 +246,17 @@ fn sched_hare_object( yield mkfile(plan, ns, "o"); // TODO: Should exes go in the cache? }; + let hare_inputs = 0z; for (let i = 0z; i < len(ver.inputs); i += 1) { let path = ver.inputs[i].path; if (strings::hassuffix(path, ".ha")) { append(harec.cmd, path); + hare_inputs += 1; }; }; + if (hare_inputs == 0) { + fmt::fatalf("Error: Module {} has no Hare input files", ns); + }; if (current) { harec.status = status::COMPLETE;