commit eff477a0c39f20c83f1970f5332b864c51e7b913
parent 67be63f1ca9c6052ed85457e84a0e44ef6cc3827
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 26 Feb 2021 15:14:08 -0500
stdlib: update
Diffstat:
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/gen-stdlib b/gen-stdlib
@@ -236,7 +236,7 @@ hare_module() {
scan.ha
gen_ssa hare::module \
hare::ast hare::lex hare::parse strio fs io strings hash \
- crypto::sha256 encoding::hex
+ crypto::sha256
}
gensrcs_hare_parse() {
diff --git a/main.ha b/main.ha
@@ -1,3 +1,4 @@
+use encoding::hex;
use fmt;
use hare::module;
use os;
@@ -14,7 +15,8 @@ export fn main() void = {
module::errstr(err)),
};
for (let i = 0z; i < len(ver.inputs); i += 1) {
- fmt::println("in: {}\t{}", ver.inputs[i].path as str,
- ver.inputs[i].hash);
+ let hash = hex::encode(ver.inputs[i].hash);
+ defer free(hash);
+ fmt::println("in: {}\t{}", ver.inputs[i].path as str, hash);
};
};
diff --git a/mk/stdlib.mk b/mk/stdlib.mk
@@ -300,7 +300,7 @@ stdlib_hare_module_srcs= \
$(STDLIB)/hare/module/context.ha \
$(STDLIB)/hare/module/scan.ha
-$(HARECACHE)/hare/module/hare.module.ssa: $(stdlib_hare_module_srcs) $(stdlib_rt) $(stdlib_hare_ast) $(stdlib_hare_lex) $(stdlib_hare_parse) $(stdlib_strio) $(stdlib_fs) $(stdlib_io) $(stdlib_strings) $(stdlib_hash) $(stdlib_crypto_sha256) $(stdlib_encoding_hex)
+$(HARECACHE)/hare/module/hare.module.ssa: $(stdlib_hare_module_srcs) $(stdlib_rt) $(stdlib_hare_ast) $(stdlib_hare_lex) $(stdlib_hare_parse) $(stdlib_strio) $(stdlib_fs) $(stdlib_io) $(stdlib_strings) $(stdlib_hash) $(stdlib_crypto_sha256)
@printf 'HAREC \t$@\n'
@mkdir -p $(HARECACHE)/hare/module
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nhare::module \
@@ -767,7 +767,7 @@ testlib_hare_module_srcs= \
$(STDLIB)/hare/module/context.ha \
$(STDLIB)/hare/module/scan.ha
-$(TESTCACHE)/hare/module/hare.module.ssa: $(testlib_hare_module_srcs) $(testlib_rt) $(testlib_hare_ast) $(testlib_hare_lex) $(testlib_hare_parse) $(testlib_strio) $(testlib_fs) $(testlib_io) $(testlib_strings) $(testlib_hash) $(testlib_crypto_sha256) $(testlib_encoding_hex)
+$(TESTCACHE)/hare/module/hare.module.ssa: $(testlib_hare_module_srcs) $(testlib_rt) $(testlib_hare_ast) $(testlib_hare_lex) $(testlib_hare_parse) $(testlib_strio) $(testlib_fs) $(testlib_io) $(testlib_strings) $(testlib_hash) $(testlib_crypto_sha256)
@printf 'HAREC \t$@\n'
@mkdir -p $(TESTCACHE)/hare/module
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nhare::module \