hare

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

commit 91b797d31abdb1148e6b64b7ac6ea08d0f40962e
parent acacd413b72f3291216be4035e91d83b34c22c77
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 26 Feb 2021 15:42:24 -0500

update stdlib

Diffstat:
Mgen-stdlib | 1+
Mmain.ha | 15++++++++++++++-
Mmk/stdlib.mk | 4+++-
3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/gen-stdlib b/gen-stdlib @@ -275,6 +275,7 @@ gensrcs_io() { stream.ha \ limit.ha \ strings.ha \ + tee.ha \ $* } diff --git a/main.ha b/main.ha @@ -14,11 +14,24 @@ export fn main() void = { err: module::error => fmt::fatal("Error scanning module: {}", module::errstr(err)), }; + let hash = hex::encode(ver.hash); fmt::println("{}: {}", hash, os::args[1]); + fmt::println("{} inputs", len(ver.inputs)); for (let i = 0z; i < len(ver.inputs); i += 1) { let hash = hex::encode(ver.inputs[i].hash); defer free(hash); - fmt::println("\t {} {}", hash, ver.inputs[i].path as str); + fmt::println("\t{} {}", hash, ver.inputs[i].path as str); + }; + + fmt::println("{} dependencies", len(ver.depends)); + for (let i = 0z; i < len(ver.depends); i += 1) { + let ident = ver.depends[i]; + fmt::printf("\t"); + for (let j = 0z; j < len(ident); j += 1) { + fmt::printf("{}{}", ident[j], + if (j + 1 < len(ident)) "::" + else "\n"); + }; }; }; diff --git a/mk/stdlib.mk b/mk/stdlib.mk @@ -336,7 +336,8 @@ stdlib_io_srcs= \ $(STDLIB)/io/println.ha \ $(STDLIB)/io/stream.ha \ $(STDLIB)/io/limit.ha \ - $(STDLIB)/io/strings.ha + $(STDLIB)/io/strings.ha \ + $(STDLIB)/io/tee.ha $(HARECACHE)/io/io.ssa: $(stdlib_io_srcs) $(stdlib_rt) $(stdlib_strings) @printf 'HAREC \t$@\n' @@ -805,6 +806,7 @@ testlib_io_srcs= \ $(STDLIB)/io/stream.ha \ $(STDLIB)/io/limit.ha \ $(STDLIB)/io/strings.ha \ + $(STDLIB)/io/tee.ha \ $(STDLIB)/io/+test/copy.ha \ $(STDLIB)/io/+test/limit.ha \ $(STDLIB)/io/+test/stream.ha \