summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-12 12:46:50 -0400
committerOri Bernstein <ori@eigenstate.org>2015-06-12 14:01:54 -0400
commit21b91ad9fa7ae830272dc67fbe3150dc30921702 (patch)
treea674ea3e28f90ba8fa2f4521069a010b4742961e /mbld
parent96c8217e913d8d6de22bbb1aa3624c26e66838fc (diff)
downloadmc-21b91ad9fa7ae830272dc67fbe3150dc30921702.tar.gz
Move fmt to fmt2.
Shit seems to work.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/build.myr38
-rw-r--r--mbld/clean.myr6
-rw-r--r--mbld/deps.myr34
-rw-r--r--mbld/fsel.myr10
-rw-r--r--mbld/install.myr18
-rw-r--r--mbld/main.myr4
-rw-r--r--mbld/opts.myr10
-rw-r--r--mbld/parse.myr22
-rw-r--r--mbld/test.myr12
-rw-r--r--mbld/util.myr30
10 files changed, 92 insertions, 92 deletions
diff --git a/mbld/build.myr b/mbld/build.myr
index 1a508ba..295e4e8 100644
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -52,7 +52,7 @@ const build = {b, targ
| `std.Some (`Gen gt): runin(b, gt.cmd, gt.dir)
| `std.Some (`Cmd ct): runin(b, ct.cmd, ct.dir)
| `std.Some (`Man mt): /* nothing needed */
- | `std.None: std.f2fatal("invalid target {}\n", targ)
+ | `std.None: std.fatal("invalid target {}\n", targ)
;;
-> true
}
@@ -67,10 +67,10 @@ const buildbin = {b, targ, addsrc
setdir(b, targ.dir)
addincludes(b, targ)
- std.f2put("{}...\n", targ.name)
+ std.put("{}...\n", targ.name)
dg = myrdeps(b, targ, false, addsrc)
if !std.hthas(dg.deps, targ.name)
- std.f2fatal("no input files for {}\n", targ.name)
+ std.fatal("no input files for {}\n", targ.name)
;;
if builddep(b, dg, targ.name, targ.incpath) || !freshlibs(targ, dg.libs)
src = std.htkeys(dg.sources)
@@ -88,11 +88,11 @@ const buildlib = {b, targ
setdir(b, targ.dir)
addincludes(b, targ)
lib = targ.name
- std.f2put("lib{}.a...\n", lib)
- archive = std.f2fmt("lib{}.a", lib)
+ std.put("lib{}.a...\n", lib)
+ archive = std.fmt("lib{}.a", lib)
dg = myrdeps(b, targ, false, false)
if !std.hthas(dg.deps, lib)
- std.f2fatal("no target declared for {}\n", lib)
+ std.fatal("no target declared for {}\n", lib)
;;
u = builddep(b, dg, targ.name, targ.incpath)
l = builddep(b, dg, archive, targ.incpath)
@@ -155,7 +155,7 @@ const builddep = {b, dg, out, incs
;;
| `std.None:
if !std.fexists(d)
- std.f2fatal("no input file {}\n", d)
+ std.fatal("no input file {}\n", d)
;;
;;
if !isfresh(d, out)
@@ -204,7 +204,7 @@ const compile = {src, incs
run(cmd)
std.slfree(o)
else
- std.f2fatal("Unknown file type for {}\n", src)
+ std.fatal("Unknown file type for {}\n", src)
;;
}
@@ -257,7 +257,7 @@ const archivelib = {dg, lib, files, incs
for c in config.Arcmd
cmd = std.slpush(cmd, std.sldup(c))
;;
- cmd = std.slpush(cmd, std.f2fmt("lib{}.a", lib))
+ cmd = std.slpush(cmd, std.fmt("lib{}.a", lib))
for f in files
obj = srcswapsuffix(f, config.Objsuffix)
cmd = std.slpush(cmd, obj)
@@ -277,7 +277,7 @@ const mergeuse = {dg, lib, files, incs
if std.hassuffix(f, ".myr")
cmd = std.slpush(cmd, srcswapsuffix(f, ".use"))
elif !std.hassuffix(f, ".s")
- std.f2fatal("unknown file type for {}\n", f)
+ std.fatal("unknown file type for {}\n", f)
;;
;;
run(cmd)
@@ -293,7 +293,7 @@ const addlibs = {cmd, libgraph, incs
/* -L incpath... */
if !config.Directlib
for inc in incs
- cmd = std.slpush(cmd, std.f2fmt("-L{}", inc))
+ cmd = std.slpush(cmd, std.fmt("-L{}", inc))
;;
;;
@@ -311,7 +311,7 @@ const addlibs = {cmd, libgraph, incs
const visit = {cmd, head, g, lib, looped, marked, incs
if std.hthas(looped, lib)
- std.f2fatal("cycle in library graph involving \"{}\"\n", lib)
+ std.fatal("cycle in library graph involving \"{}\"\n", lib)
elif std.hthas(marked, lib)
-> cmd
;;
@@ -327,11 +327,11 @@ const visit = {cmd, head, g, lib, looped, marked, incs
const putlib = {cmd, head, lib, incs
if !config.Directlib
- -> std.slput(cmd, head, std.f2fmt("-l", lib))
+ -> std.slput(cmd, head, std.fmt("-l{}", lib))
else
match findlib(lib, incs)
| `std.None:
- std.f2fatal("could not find library lib{}.a\n", lib)
+ std.fatal("could not find library lib{}.a\n", lib)
| `std.Some p:
-> std.slput(cmd, head, p)
;;
@@ -342,7 +342,7 @@ const findlib = {lib, incs
var buf : byte[512]
var sl, p
- sl = std.bfmt(buf[:], "lib%s.a", lib)
+ sl = std.bfmt(buf[:], "lib{}.a", lib)
for i in incs
p = std.pathcat(i, sl)
if std.fexists(p)
@@ -366,10 +366,10 @@ const freshlibs = {targ, libgraph
;;
std.slfree(lib)
| `std.None:
- std.f2fput(1, "{}: could not find library lib{}.a\n", targ.name, l)
- std.f2fput(1, "searched:\n")
+ std.fput(1, "{}: could not find library lib{}.a\n", targ.name, l)
+ std.fput(1, "searched:\n")
for inc in targ.incpath
- std.f2fput(1, "\t{}\n", inc)
+ std.fput(1, "\t{}\n", inc)
;;
std.exit(1)
;;
@@ -401,7 +401,7 @@ const isfresh = {src, dst
*/
match std.fmtime(src)
| `std.Some mt: srcmt = mt
- | `std.None: std.f2fatal("could not stat {}\n", src)
+ | `std.None: std.fatal("could not stat {}\n", src)
;;
match std.fmtime(dst)
| `std.Some mt: dstmt = mt
diff --git a/mbld/clean.myr b/mbld/clean.myr
index 6f4fb2f..02d9a8f 100644
--- a/mbld/clean.myr
+++ b/mbld/clean.myr
@@ -24,7 +24,7 @@ const cleanall = {b
| `Gen gt:
for f in gt.out
if !gt.durable && std.remove(f)
- std.f2put("\tclean {}\n", f)
+ std.put("\tclean {}\n", f)
;;
;;
| `Cmd ct: /* nothing to do */
@@ -52,7 +52,7 @@ const clean = {b, targ
| `Gen gt:
for f in gt.out
if !gt.durable && std.remove(f)
- std.f2put("\tclean {}\n", f)
+ std.put("\tclean {}\n", f)
;;
;;
| `Cmd ct:
@@ -80,7 +80,7 @@ const cleanup = {b, targ, leaves
keys = std.htkeys(dg.deps)
for k in keys
if !std.htgetv(mchammer_files, k, false) && std.remove(k)
- std.f2put("\tclean {}\n", k)
+ std.put("\tclean {}\n", k)
;;
;;
}
diff --git a/mbld/deps.myr b/mbld/deps.myr
index 2a99612..b79447c 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -48,7 +48,7 @@ const myrdeps = {b, mt, doclean, addsrc
])
/* direct dependencies of binary */
if mt.islib
- out = std.f2fmt("lib{}.a", mt.name)
+ out = std.fmt("lib{}.a", mt.name)
useout = std.sldup(mt.name)
else
out = std.sldup(mt.name)
@@ -106,13 +106,13 @@ const dumpgraph = {dg
->
;;
keys = std.htkeys(dg.deps)
- std.f2put("digraph dg {{\n")
+ std.put("digraph dg {{\n")
for k in keys
for v in std.htgetv(dg.deps, k, ["WTFUNKNOWN!"][:])
- std.f2put("\t\"{}\" -> \"{}\";\n", k, v)
+ std.put("\t\"{}\" -> \"{}\";\n", k, v)
;;
;;
- std.f2put("}\n")
+ std.put("}\n")
}
const srcdeps = {b, ds, g, path, obj, usefile
@@ -124,7 +124,7 @@ const srcdeps = {b, ds, g, path, obj, usefile
ds.depstk = std.slpush(ds.depstk, path)
if std.htgetv(g.seen, path, false)
- std.f2fput(1, "dependency loop involving {}:\n", path)
+ std.fput(1, "dependency loop involving {}:\n", path)
for d in ds.depstk
std.fput(1, "\t{}\n", d)
;;
@@ -144,7 +144,7 @@ const srcdeps = {b, ds, g, path, obj, usefile
;;
| `Local (l, lnum):
if !std.hassuffix(l, ".use")
- std.f2fatal("{}:{}: local dependency \"{}\" should end with .use\n", path, lnum, l)
+ std.fatal("{}:{}: local dependency \"{}\" should end with .use\n", path, lnum, l)
;;
if obj.len != 0
pushdep(g, l, obj)
@@ -165,7 +165,7 @@ const addusedep = {b, ds, g, f, usefile, line
if std.hthas(g.done, usefile)
if opt_debug
- std.f2put("already loaded deps for {}\n", usefile)
+ std.put("already loaded deps for {}\n", usefile)
;;
->
;;
@@ -177,7 +177,7 @@ const addusedep = {b, ds, g, f, usefile, line
if ds.addsrc
std.htput(g.sources, src, true)
elif !std.hthas(g.input, usefile)
- std.f2fatal("{}:{}: source file {} not listed in bldfile\n", f, line, src)
+ std.fatal("{}:{}: source file {} not listed in bldfile\n", f, line, src)
;;
;;
pushdep(g, src, usefile)
@@ -194,12 +194,12 @@ const getdeps = {b, ds, path
if !std.fexists(path)
match std.htget(b.gensrc, path)
| `std.Some gt: run(gt.cmd)
- | `std.None: std.f2fatal("no input file {}\n", path)
+ | `std.None: std.fatal("no input file {}\n", path)
;;
;;
match bio.open(path, bio.Rd)
| `std.Some fd: f = fd
- | `std.None: std.f2fatal("could not open {}\n", path)
+ | `std.None: std.fatal("could not open {}\n", path)
;;
lnum = 0
@@ -230,14 +230,14 @@ const scrapelibs = {dg, lib, incs
f = openlib(lib, incs)
match bio.getc(f)
| `std.Some 'U': /* nothing */
- | `std.Some _: std.f2fatal("library {}: corrupt or invalid usefile\n", lib)
- | `std.None: std.f2fatal("library {}: could not read usefile\n", lib)
+ | `std.Some _: std.fatal("library {}: corrupt or invalid usefile\n", lib)
+ | `std.None: std.fatal("library {}: could not read usefile\n", lib)
;;
match bio.getbe32(f)
| `std.Some 1: /* nothing: version matches. */
- | `std.Some 0: std.f2fput(1, "library {}: warning: old usefile version\n", lib)
- | `std.Some _: std.f2fatal("library {}: usefile version unknown\n", lib)
- | `std.None: std.f2fatal("library {}: corrutpt or invalid usefile\n", lib)
+ | `std.Some 0: std.fput(1, "library {}: warning: old usefile version\n", lib)
+ | `std.Some _: std.fatal("library {}: usefile version unknown\n", lib)
+ | `std.None: std.fatal("library {}: corrutpt or invalid usefile\n", lib)
;;
std.slfree(rdstr(f))
done = false
@@ -276,7 +276,7 @@ const openlib = {lib, incs
| `std.None:
/* nothing */
;;
- std.f2fatal("could not find library {}.\n", lib)
+ std.fatal("could not find library {}.\n", lib)
}
const depname = {deps, ln, lnum
@@ -304,7 +304,7 @@ const pushdep = {dg, src, dst
var sl
if opt_debug
- std.f2put("{} <= {}\n", dst, src)
+ std.put("{} <= {}\n", dst, src)
;;
std.assert(dst.len < 200, "BUG!")
sl = std.htgetv(dg.deps, dst, [][:])
diff --git a/mbld/fsel.myr b/mbld/fsel.myr
index e40d16c..7b4423d 100644
--- a/mbld/fsel.myr
+++ b/mbld/fsel.myr
@@ -35,11 +35,11 @@ const fseladd = {fsel, f
basename = f[:i]
match std.strrfind(f[i+1:], ".")
| `std.Some j: attrs = f[i+1:][:j]
- | `std.None: std.fatal("unrecognized type for file %s\n", f)
+ | `std.None: std.fatal("unrecognized type for file {}\n", f)
;;
| `std.None:
match std.strrfind(f, ".")
- | `std.None: std.fatal("unrecognized type for file %s\n", f)
+ | `std.None: std.fatal("unrecognized type for file {}\n", f)
| `std.Some i:
basename = f[:i]
attrs = ""
@@ -72,7 +72,7 @@ const fselfin = {fsel
for k in keys
nmatch = std.htgetv(fsel._match, k, -1)
if nmatch == -1
- std.fatal("no applicable file for '%s'\n", k)
+ std.fatal("no applicable file for '{}'\n", k)
;;
ret = std.slpush(ret, std.htgetv(fsel._best, k, ""))
;;
@@ -89,7 +89,7 @@ const addsysattrs = {sa
| "osx": attrs = ["osx", "posixy"][:]
| "linux": attrs = ["linux", "posixy"][:]
| "plan9": attrs = ["plan9"][:]
- | unknown: std.fatal("unknown system \"%s\"\n", unknown)
+ | unknown: std.fatal("unknown system \"{}\"\n", unknown)
;;
for a in attrs
std.htput(sa, a, true)
@@ -97,7 +97,7 @@ const addsysattrs = {sa
match opt_arch
| "x64": attrs = ["x64"][:]
- | unknown: std.fatal("unknown arch %s\n", unknown)
+ | unknown: std.fatal("unknown arch {}\n", unknown)
;;
for a in attrs
std.htput(sa, a, true)
diff --git a/mbld/install.myr b/mbld/install.myr
index e88a43a..a36eee2 100644
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -34,7 +34,7 @@ const movetargs = {b, rm
| `Lib lt:
if lt.install
movefile(b, rm, lt.dir, lt.name, config.Libpath, 0o644)
- libarchive = std.f2fmt("lib{}.a", lt.name)
+ libarchive = std.fmt("lib{}.a", lt.name)
movefile(b, rm, lt.dir, libarchive, config.Libpath, 0o644)
std.slfree(libarchive)
;;
@@ -60,18 +60,18 @@ const movefile = {b, rm, dir, file, prefix, perm
setdir(b, dir)
path = std.pathjoin([opt_destdir, opt_instroot, prefix, file][:])
if rm
- std.f2put("\trm {}\n", path)
+ std.put("\trm {}\n", path)
if !std.remove(path)
- std.f2put("\t\tno such file {}\n", file)
+ std.put("\t\tno such file {}\n", file)
;;
else
- std.f2put("\t{} => {}\n", file, path)
+ std.put("\t{} => {}\n", file, path)
std.remove(path)
match std.slurp(file)
- | `std.Fail m: std.f2fatal("Could not open {} for reading\n", file)
+ | `std.Fail m: std.fatal("Could not open {} for reading\n", file)
| `std.Ok buf:
if !std.blat(path, buf, perm)
- std.f2put("Could not write {}\n", file)
+ std.put("Could not write {}\n", file)
;;
std.slfree(buf)
;;
@@ -84,15 +84,15 @@ const moveman = {b, rm, dir, man
match std.strrfind(man, ".")
| `std.None:
- std.f2fatal("manpage {} has no section\n", man)
+ std.fatal("manpage {} has no section\n", man)
| `std.Some s:
sect = s + 1
if s + 1 == man.len
- std.f2fatal("manpage {} missing suffix\n", man)
+ std.fatal("manpage {} missing suffix\n", man)
;;
;;
- manrel = std.f2fmt("{}{}", opt_manpath, man[sect:])
+ manrel = std.fmt("{}{}", opt_manpath, man[sect:])
movefile(b, rm, dir, man, manrel, 0o644)
std.slfree(manrel)
}
diff --git a/mbld/main.myr b/mbld/main.myr
index f6d2dcb..a78db6f 100644
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -96,7 +96,7 @@ const main = {args : byte[:][:]
findproj(b, "bld.proj")
bld.load(b)
for t in b.all
- std.f2put("{}\n", t)
+ std.put("{}\n", t)
;;
else
findproj(b, "bld.proj")
@@ -133,7 +133,7 @@ const mkbuild = {
const findproj = {b, bldfile
if !findbase(b, bldfile) || !std.chdir(b.basedir)
- std.f2fatal("could not find {}\n", bldfile)
+ std.fatal("could not find {}\n", bldfile)
;;
bld.setdir(b, "")
}
diff --git a/mbld/opts.myr b/mbld/opts.myr
index 7c4f0f2..0fd4465 100644
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -56,13 +56,13 @@ const initopts = {
| "Darwin": opt_sys = "osx"
| "FreeBSD": opt_sys = "freebsd"
| "Plan9": opt_sys = "plan9"
- | unknown: std.fatal("unknown system \"%s\"\n", unknown)
+ | unknown: std.fatal("unknown system \"{}\"\n", unknown)
;;
match si.arch
| "x86_64": opt_arch = "x64"
| "amd64": opt_arch = "x64"
- | unknown: std.fatal("unknown architecture \"%s\"\n", unknown)
+ | unknown: std.fatal("unknown architecture \"{}\"\n", unknown)
;;
opt_incpaths = [][:]
@@ -76,8 +76,8 @@ const initopts = {
opt_runtime = std.pathjoin([opt_instroot, config.Libpath, config.Runtime][:])
;;
- sysarchstr = std.fmt("+%s-%s", opt_sys, opt_arch)
- sysstr = std.fmt("+%s", opt_sys)
- archstr = std.fmt("+%s", opt_arch)
+ sysarchstr = std.fmt("+{}-{}", opt_sys, opt_arch)
+ sysstr = std.fmt("+{}", opt_sys)
+ archstr = std.fmt("+{}", opt_arch)
}
diff --git a/mbld/parse.myr b/mbld/parse.myr
index 88043dc..5f7f9fe 100644
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -59,7 +59,7 @@ const loadall = {b, path, dir
loadall(b, subproj, subpath)
b.basedir = curbase
else
- std.f2fatal("could not open {} or {} \n", subbld, subproj)
+ std.fatal("could not open {} or {} \n", subbld, subproj)
;;
std.slfree(subbld)
std.slfree(subproj)
@@ -91,7 +91,7 @@ const sortdeps = {b
const visit = {all, b, targ, looped, marked
if std.hthas(looped, targ)
- std.f2fatal("cycle in build depgraph involving {}\n", targ)
+ std.fatal("cycle in build depgraph involving {}\n", targ)
elif std.hthas(marked, targ)
-> all
;;
@@ -109,7 +109,7 @@ const getdeps = {targ
match targ
| `Bin t: -> t.libdeps
| `Lib t: -> t.libdeps
- | _: std.f2fatal("depending on non-library target")
+ | _: std.fatal("depending on non-library target")
;;
}
@@ -123,7 +123,7 @@ const mkparser = {path, dir, basedir
p.basedir = std.sldup(basedir)
match std.slurp(path)
| `std.Ok d: p.data = d
- | `std.Fail _: std.f2fatal("could not open '{}'\n", path)
+ | `std.Fail _: std.fatal("could not open '{}'\n", path)
;;
p.rest = p.data
-> p
@@ -144,8 +144,8 @@ const failparse = {p, msg, args : ...
var sl
ap = std.vastart(&args)
- sl = std.bfmtv(buf[:], msg, ap)
- std.f2fput(1, "{}:{}: {}", p.fname, p.line, sl)
+ sl = std.bfmtv(buf[:], msg, &ap)
+ std.fput(1, "{}:{}: {}", p.fname, p.line, sl)
std.exit(1)
}
@@ -353,7 +353,7 @@ const myrtarget = {p, targ
| ("noinst", ""): inst = false
| ("sys", tags): systags = std.slpush(systags, tags)
| (invalid, _):
- std.f2fatal("{}: got invalid attr '{}'\n", targ, invalid)
+ std.fatal("{}: got invalid attr '{}'\n", targ, invalid)
;;
;;
for inc in bld.opt_incpaths
@@ -596,7 +596,7 @@ const getc = {p
const addtarg = {p, b, name, targ
var tn
- tn = std.f2fmt("{}:{}", p.fdir, name)
+ tn = std.fmt("{}:{}", p.fdir, name)
if std.hthas(b.targs, tn)
failparse(p, "duplicate target {}\n", tn)
;;
@@ -611,10 +611,10 @@ const libpath = {p, libpath
| `std.None:
dir = std.sldup(".")
lib = std.sldup(libpath)
- targ = std.f2fmt("{}:{}", p.fdir, lib)
+ targ = std.fmt("{}:{}", p.fdir, lib)
| `std.Some idx:
if idx == libpath.len
- std.f2fatal("libdep {} missing library after ':'\n")
+ std.fatal("libdep {} missing library after ':'\n")
;;
/* absolute path */
if std.hasprefix(libpath, "@/") || std.hasprefix(libpath, "@:")
@@ -627,7 +627,7 @@ const libpath = {p, libpath
lib = std.sldup(libpath[idx+1:])
targ = std.pathcat(p.fdir, libpath)
if std.hasprefix(targ, "../")
- std.f2fatal("library {} outside of project\n", libpath)
+ std.fatal("library {} outside of project\n", libpath)
;;
;;
;;
diff --git a/mbld/test.myr b/mbld/test.myr
index 4f253ae..19c2dce 100644
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -55,9 +55,9 @@ const test = {b
;;
if hastest
if ok
- std.f2put("TESTS PASSED\n")
+ std.put("TESTS PASSED\n")
else
- std.f2put("TESTS FAILED\n")
+ std.put("TESTS FAILED\n")
std.exit(1)
;;
;;
@@ -121,11 +121,11 @@ const cleantest = {b, src
const runtest = {bin
var r, log
- std.f2put("run {}:\t", bin)
+ std.put("run {}:\t", bin)
log = std.strcat(bin, ".log")
match std.spork([bin][:])
| `std.Fail m:
- std.f2fatal("unable to run test: {}\n", m)
+ std.fatal("unable to run test: {}\n", m)
| `std.Ok (pid, infd, outfd):
match std.fslurp(outfd)
| `std.Ok "": /* empty output; nothing to log */
@@ -137,8 +137,8 @@ const runtest = {bin
r = false
match std.wait(pid)
- | `std.Wfailure: std.f2put("FAIL\n")
- | `std.Wsignalled: std.f2put("CRASH\n")
+ | `std.Wfailure: std.put("FAIL\n")
+ | `std.Wsignalled: std.put("CRASH\n")
| `std.Wsuccess:
std.put("PASS\n")
r = true
diff --git a/mbld/util.myr b/mbld/util.myr
index 3325e66..6bb9de3 100644
--- a/mbld/util.myr
+++ b/mbld/util.myr
@@ -20,30 +20,30 @@ const run = {cmd
printcmd(cmd)
pid = std.fork()
if pid == -1
- std.f2fatal("could not fork command\n")
+ std.fatal("could not fork command\n")
elif pid == 0
if std.execvp(cmd[0], cmd) < 0
- std.f2fatal("failed to exec {}\n", cmd[0])
+ std.fatal("failed to exec {}\n", cmd[0])
;;
else
match std.wait(pid)
| `std.Wsuccess: /* nothing */
- | `std.Wfailure: std.f2fatal("FAIL: \"{}\"\n", std.strjoin(cmd, " "))
- | `std.Wsignalled: std.f2fatal("CRASH: \"{}\"\n", std.strjoin(cmd, " "))
- | `std.Waiterror: std.f2fatal("WAT: \"{}\"\n", std.strjoin(cmd, " "))
+ | `std.Wfailure: std.fatal("FAIL: \"{}\"\n", std.strjoin(cmd, " "))
+ | `std.Wsignalled: std.fatal("CRASH: \"{}\"\n", std.strjoin(cmd, " "))
+ | `std.Waiterror: std.fatal("WAT: \"{}\"\n", std.strjoin(cmd, " "))
;;
;;
}
const printcmd = {lst
if lst.len > 0
- std.f2put("\t")
- std.f2put("{}\t", lst[0])
+ std.put("\t")
+ std.put("{}\t", lst[0])
for l in lst[1:]
- std.f2put("{} ", l)
+ std.put("{} ", l)
;;
;;
- std.f2put("\n")
+ std.put("\n")
}
const srcsplit = {src
@@ -73,7 +73,7 @@ const swapsuffix = {f, suff, newsuff
if std.hassuffix(f, suff)
f = f[:f.len - suff.len]
;;
- -> std.f2fmt("{}{}", f, newsuff)
+ -> std.fmt("{}{}", f, newsuff)
}
const srcswapsuffix = {src, new
@@ -85,7 +85,7 @@ const srcswapsuffix = {src, new
elif std.sleq(suff, ".s")
-> std.strcat(base, new)
else
- std.f2fatal("unrecognized source {}\n", src)
+ std.fatal("unrecognized source {}\n", src)
;;
}
@@ -98,7 +98,7 @@ const strlistfree = {sl
const gettarg = {tab, n
match std.htget(tab, n)
- | `std.None: std.f2fatal("internal: nonexistent {}\n", n)
+ | `std.None: std.fatal("internal: nonexistent {}\n", n)
| `std.Some t: -> t
;;
}
@@ -109,12 +109,12 @@ const setdir = {b, dir
if !std.sleq(b.curdir, dir)
p = std.pathcat(b.basedir, dir)
if b.curdir.len != 0
- std.f2put("Leaving directory '{}'\n", b.curdir)
+ std.put("Leaving directory '{}'\n", b.curdir)
;;
- std.f2put("Entering directory '{}'\n", dir)
+ std.put("Entering directory '{}'\n", dir)
if !std.chdir(p)
- std.f2fatal("could not cd into {}\n", p)
+ std.fatal("could not cd into {}\n", p)
;;
b.curdir = dir
std.slfree(p)