hare

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

commit f6760e9e25d5607c430e6b204ea80f2db68679f0
parent fea641da0a228fcd33a1168c039c95a01bbf4c7a
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun,  2 Jan 2022 13:47:34 +0100

all: updates for append/insert overhaul

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mcmd/hare/schedule.ha | 9+++++----
Mos/exec/cmd.ha | 3++-
2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha @@ -188,7 +188,7 @@ fn sched_hare_object( let env = module::identuscore(namespace); defer free(env); - append(harec.cmd, "-N", ns); + append(harec.cmd, ["-N", ns]...); append(plan.environ, ( fmt::asprintf("HARE_VERSION_{}", env), version, )); @@ -223,14 +223,14 @@ fn sched_hare_object( fmt::fatal("Error: mkdirs {}: {}", path, fs::strerror(err)); }; - append(harec.cmd, "-t", path::join(path, td)); + append(harec.cmd, ["-t", path::join(path, td)]...); yield path::join(path, name); } else { // XXX: This is probably kind of dumb // It would be better to apply any defines which affect this // namespace instead for (let i = 0z; i < len(plan.context.defines); i += 1) { - append(harec.cmd, "-D", plan.context.defines[i]); + append(harec.cmd, ["-D", plan.context.defines[i]]...); }; yield mkfile(plan, ns, "o"); // TODO: Should exes go in the cache? @@ -287,6 +287,7 @@ fn sched_hare_exe( // TODO: We should be able to use partial variadic application let link: []*task = alloc([], len(depend)); defer free(link); - append(link, obj, depend...); + append(link, obj); + append(link, depend...); return sched_ld(plan, strings::dup(output), link...); }; diff --git a/os/exec/cmd.ha b/os/exec/cmd.ha @@ -41,7 +41,8 @@ export fn cmd(name: str, args: str...) (command | error) = { files = [], ... }; - append(cmd.argv, name, args...); + append(cmd.argv, name); + append(cmd.argv, args...); append(cmd.env, env...); return cmd; };