ref: 492aca3ff6f829ee09c52e17c86a808430ee7df4
parent: 11f79ed8ff75049f6b1866d70bc032c8d18b1463
author: Ori Bernstein <[email protected]>
date: Mon Jul 17 11:30:01 EDT 2017
Convert from `in` to `:`. The winds of change are a-blowin.
--- a/bench/runbench.myr
+++ b/bench/runbench.myr
@@ -7,7 +7,7 @@
std.put("Running benchmarks: {} samples per binary\n", Nsamp);
tot = 0.0;
- for arg in args[1:]
+ for arg : args[1:]
tot = tot + timeit(arg)
;;
std.put("total:\t{}s\n", tot);
--- a/bench/runner.myr
+++ b/bench/runner.myr
@@ -3,7 +3,7 @@
const Nsamp = 10
const main = {args : byte[:][:]
- for a in args
+ for a : args
time(a)
;;
}
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -354,7 +354,7 @@
}
/* ensures we have enough to read a single codepoint in the buffer */
-const ensurecodepoint : (f : file# -> status(std.size)) = {f
+const ensurecodepoint = {f
var b
var len
@@ -702,7 +702,7 @@
-> errtype(e)
}
-const errtype : (e : std.errno -> ioerr )= {e : std.errno -> ioerr
+const errtype = {e : std.errno -> ioerr
var errno
errno = (e : std.errno)
--- a/lib/crypto/test/aes.myr
+++ b/lib/crypto/test/aes.myr
@@ -8,28 +8,28 @@
;;
const main = {
- for tc in ECBVarKey128encvecs
+ for tc : ECBVarKey128encvecs
enctest(tc)
;;
- for tc in ECBVarKey192encvecs
+ for tc : ECBVarKey192encvecs
enctest(tc)
;;
- for tc in ECBVarKey256encvecs
+ for tc : ECBVarKey256encvecs
enctest(tc)
;;
- for tc in ECBVarKey128decvecs
+ for tc : ECBVarKey128decvecs
dectest(tc)
;;
- for tc in ECBVarKey192decvecs
+ for tc : ECBVarKey192decvecs
dectest(tc)
;;
- for tc in ECBVarKey256decvecs
+ for tc : ECBVarKey256decvecs
dectest(tc)
;;
- for tc in ECBVarKey128encbigvecs
+ for tc : ECBVarKey128encbigvecs
bigenctest(tc)
;;
- for tc in ECBVarKey128decbigvecs
+ for tc : ECBVarKey128decbigvecs
bigdectest(tc)
;;
}
--- a/lib/crypto/test/chacha20.myr
+++ b/lib/crypto/test/chacha20.myr
@@ -848,7 +848,7 @@
crypto.chacha20keysetup(&st, chk.key)
crypto.chacha20ivsetup(&st, chk.iv)
- for (i, s) in std.byenum(chk.state)
+ for (i, s) : std.byenum(chk.state)
std.assert(st.input[i] == s, "mismatched state\n")
;;
--- a/lib/crypto/test/util.myr
+++ b/lib/crypto/test/util.myr
@@ -8,7 +8,7 @@
var sb, str
sb = std.mksb()
- for x in got
+ for x : got
std.sbfmt(sb, "{p=0,w=2,x}", x)
;;
str = std.sbfin(sb)
--- a/lib/date/fmt.myr
+++ b/lib/date/fmt.myr
@@ -18,7 +18,7 @@
][:])
}
-/* Always formats in proleptic Gregorian format */
+/* Always formats : proleptic Gregorian format */
const sbfmt = {sb, ap, opts
var d : instant
var fmt
@@ -25,7 +25,7 @@
d = std.vanext(ap)
fmt = Datetimefmt;
- for o in opts
+ for o : opts
match o
| ("d", ""): fmt = Datefmt
| ("t", ""): fmt = Timefmt
--- a/lib/date/test/fmt.myr
+++ b/lib/date/test/fmt.myr
@@ -31,7 +31,7 @@
d = date.mkinstant(-50000000000*1_000_000, "")
eq("385-7-25 07:06:40 +0000", std.bfmt(buf[:], "{D}", d))
- /* date in the bc */
+ /* date : the bc */
d = date.mkinstant(-70000000000*1_000_000, "")
eq("-249-11-19 19:33:20 +0000", std.bfmt(buf[:], "{D}", d))
--- a/lib/date/types.myr
+++ b/lib/date/types.myr
@@ -4,14 +4,14 @@
type instant = struct
actual : std.time /* epoch time in microseconds */
tzoff : duration /* timezone offset in microseconds */
- year : int /* year, starting at 0 (ie, 1 BCE) */
- mon : int /* month, [1..12] */
- day : int /* day, [1..31] */
- wday : int /* weekday, [0..6] */
- h : int /* hour: [0..23] */
- m : int /* minute: [0..59] */
- s : int /* second: [0..59] */
- us : int /* microsecond: [0..999,999] */
+ year : int /* year, starting at 0 (ie, 1 BCE) */
+ mon : int /* month, [1..12] */
+ day : int /* day, [1..31] */
+ wday : int /* weekday, [0..6] */
+ h : int /* hour: [0..23] */
+ m : int /* minute: [0..59] */
+ s : int /* second: [0..59] */
+ us : int /* microsecond: [0..999,999] */
tzname : byte[:] /* current time zone name */
_tzbuf : byte[32] /* current time zone name storage */
;;
--- a/lib/date/zoneinfo+posixy.myr
+++ b/lib/date/zoneinfo+posixy.myr
@@ -47,7 +47,7 @@
path = std.sldup("/etc/localtime")
else
path = ""
- for z in zonepath
+ for z : zonepath
path = std.pathcat(z, tz)
if sys.stat(path, &sb) == 0
goto found
--- a/lib/escfmt/eschtml.myr
+++ b/lib/escfmt/eschtml.myr
@@ -19,7 +19,7 @@
var s : byte[:]
s = std.vanext(ap)
- for c in std.bychar(s)
+ for c : std.bychar(s)
match c
| '&': std.sbputs(sb, "&")
| '<': std.sbputs(sb, "<")
--- a/lib/escfmt/escre.myr
+++ b/lib/escfmt/escre.myr
@@ -19,7 +19,7 @@
var s : byte[:]
s = std.vanext(ap)
- for c in std.bychar(s)
+ for c : std.bychar(s)
match c
| '|': std.sbputs(sb, "\\|")
| '*': std.sbputs(sb, "\\*")
--- a/lib/escfmt/escsh.myr
+++ b/lib/escfmt/escsh.myr
@@ -20,7 +20,7 @@
s = std.vanext(ap)
std.sbputb(sb, ('\'' : byte))
- for b in s
+ for b : s
if b == ('\'' : byte)
std.sbputs(sb, "'\\''")
else
--- a/lib/escfmt/escurl.myr
+++ b/lib/escfmt/escurl.myr
@@ -19,7 +19,7 @@
var s : byte[:]
s = std.vanext(ap)
- for b in s
+ for b : s
match (b : char)
| ':': std.sbfmt(sb, "%{x}", b)
| '/': std.sbfmt(sb, "%{x}", b)
--- a/lib/inifile/parse.myr
+++ b/lib/inifile/parse.myr
@@ -25,12 +25,12 @@
}
const free = {ini
- for ((sect, key), val) in std.byhtkeyvals(ini.elts)
+ for ((sect, key), val) : std.byhtkeyvals(ini.elts)
std.slfree(val)
std.slfree(sect)
std.slfree(key)
;;
- for s in ini.sects
+ for s : ini.sects
std.slfree(s)
;;
std.slfree(ini.sects)
--- a/lib/inifile/test/inifile.myr
+++ b/lib/inifile/test/inifile.myr
@@ -43,7 +43,7 @@
ini = std.try(inifile.load("test/test.ini"))
somesect=0
anothersection=0
- for k in inifile.bysection(ini)
+ for k : inifile.bysection(ini)
match k
| "somesect": somesect++
| "another section": anothersection++
--- a/lib/inifile/write.myr
+++ b/lib/inifile/write.myr
@@ -44,7 +44,7 @@
})
oldsect = ""
- for (sect, key) in keys
+ for (sect, key) : keys
std.put("sect={}, oldsect={}\n", sect, oldsect)
if !std.sleq(sect, oldsect)
bio.put(f, "[{}]\n", sect)
--- a/lib/json/fmt.myr
+++ b/lib/json/fmt.myr
@@ -32,7 +32,7 @@
const jstrfmt = {sb, str
std.sbputs(sb, "\"")
- for c in str
+ for c : str
match (c : char)
| '\x0c': std.sbputs(sb, "\\f")
| '\\': std.sbputs(sb, "\\\\")
@@ -50,7 +50,7 @@
sep = ""
std.sbputs(sb, "[\n")
- for e in arr
+ for e : arr
std.sbputs(sb, sep)
indent(sb, ind + 1)
eltfmt(sb, e, ind + 1)
@@ -66,7 +66,7 @@
sep = ""
std.sbputs(sb, "{\n")
- for (k, v) in obj
+ for (k, v) : obj
std.sbputs(sb, sep)
indent(sb, ind + 1)
jstrfmt(sb, k)
--- a/lib/json/parse.myr
+++ b/lib/json/parse.myr
@@ -51,11 +51,11 @@
| &(`Num _): /* nothing */
| &(`Str s): std.slfree(s)
| &(`Arr a):
- for e in a
+ for e : a
free(e)
;;
| &(`Obj o):
- for (k, v) in o
+ for (k, v) : o
std.slfree(k)
free(v)
;;
@@ -124,7 +124,7 @@
exit(p)
-> `std.Ok std.mk(`Obj membs)
:error
- for (k, v) in membs
+ for (k, v) : membs
std.slfree(k)
free(v)
;;
@@ -196,7 +196,7 @@
exit(p)
-> `std.Ok std.mk(`Arr elts)
:error
- for e in elts
+ for e : elts
free(e)
;;
std.slfree(elts)
--- a/lib/json/test/parse.myr
+++ b/lib/json/test/parse.myr
@@ -94,7 +94,7 @@
var dir, data, path
dir = std.try(std.diropen("test/inputs"))
- for f in std.byentry(dir)
+ for f : std.byentry(dir)
path = std.pathcat("test/inputs", f)
data = std.try(std.slurp(path))
/* 'n' indicates expected failure, 'y' indicates expected success, 'i' indicates implementation defined */
@@ -104,7 +104,7 @@
[.name=f, .fn={ctx
match json.parse(data)
| `std.Err e: /* ok */
- | `std.Ok r: testr.fail(ctx, "succeeded in parsing malformed json: {}\n", r)
+ | `std.Ok r: testr.fail(ctx, "succeeded : parsing malformed json: {}\n", r)
std.die("hah")
;;
}]
--- a/lib/regex/compile.myr
+++ b/lib/regex/compile.myr
@@ -85,7 +85,7 @@
if re.debug
std.htfree(re.astloc)
std.slfree(re.pcidx)
- for bs in re.traces
+ for bs : re.traces
std.bsfree(bs)
;;
std.slfree(re.traces)
@@ -128,7 +128,7 @@
/* generate a trie of ranges */
rt = std.zalloc()
- for r in sl
+ for r : sl
/*
encode:
lo => bounds[loidx] - 1
@@ -226,7 +226,7 @@
}
const rtfree = {rt
- for l in rt.link
+ for l : rt.link
rtfree(l)
;;
std.slfree(rt.link)
@@ -270,7 +270,7 @@
sz = 0
else
sz = 2*rt.ranges.len - 1
- for l in rt.link
+ for l : rt.link
sz += rangeprogsize(l)
;;
;;
@@ -454,7 +454,7 @@
std.put("Chr {}\n", c)
| `Ranges rl:
std.put("Ranges")
- for r in rl
+ for r : rl
for var i = 0; i < indent + 1; i++
std.put(" ")
;;
@@ -797,7 +797,7 @@
neg = [][:]
start = 0
next = 0 /* if we have no ranges */
- for r in rng
+ for r : rng
(end, next) = (r[0], r[1])
std.slpush(&neg, [start, end - 1])
start = next + 1
@@ -817,7 +817,7 @@
ret = [][:]
lo = rl[0][0]
hi = rl[0][1]
- for r in rl[1:]
+ for r : rl[1:]
/* if it overlaps or abuts, merge */
if r[0] <= hi + 1
hi = r[1]
--- a/lib/regex/interp.myr
+++ b/lib/regex/interp.myr
@@ -223,7 +223,7 @@
re.runq = mkthread(re, 0)
if re.debug
/* The last run could have left things here, since we need this info after the run */
- for bs in re.traces
+ for bs : re.traces
std.bsfree(bs)
;;
std.slfree(re.traces)
--- a/lib/regex/redump.myr
+++ b/lib/regex/redump.myr
@@ -16,7 +16,7 @@
[.opt='v', .desc="dump verbose regex output"]
][:],
])
- for opt in cmd.opts
+ for opt : cmd.opts
match opt
| ('v', _): verbose = true
| _: std.fatal("Unknown argument")
@@ -43,7 +43,7 @@
const runall = {re, files
- for f in files
+ for f : files
match bio.open(f, bio.Rd)
| `std.Ok fd:
dump(re, fd)
@@ -112,7 +112,7 @@
;;
std.put("\t")
- for h in hit
+ for h : hit
if h
std.put("^")
else
--- a/lib/std/bigint.myr
+++ b/lib/std/bigint.myr
@@ -252,7 +252,7 @@
fit in one digit.
*/
v = mkbigint(1)
- for c in std.bychar(str)
+ for c : std.bychar(str)
if c == '_'
continue
;;
--- a/lib/std/bitset.myr
+++ b/lib/std/bitset.myr
@@ -67,7 +67,7 @@
var n
n = 0
- for v in bybsvalue(bs)
+ for v : bybsvalue(bs)
n++
;;
-> n
--- a/lib/std/bytealloc.myr
+++ b/lib/std/bytealloc.myr
@@ -56,7 +56,8 @@
nfree : size /* the number of free nodes */
;;
-type chunk = struct /* NB: must be smaller than sizeof(slab) */
+/* NB: must be smaller than sizeof(slab) */
+type chunk = struct
next : chunk# /* the next chunk in the free list */
;;
--- a/lib/std/dial+posixy.myr
+++ b/lib/std/dial+posixy.myr
@@ -22,6 +22,7 @@
a map from service name to a list of (port,proto)
pairs in order of preference
*/
+
/* FIXME: implement
var services : htab(byte[:], [int, byte[:]][:])#
var inited = false
--- a/lib/std/env+posixy.myr
+++ b/lib/std/env+posixy.myr
@@ -26,7 +26,7 @@
var n, env
envinit()
- for envp in environ
+ for envp : environ
env = cstrconvp(envp)
n = min(name.len, env.len)
if sleq(name, env[:n]) && sleq(env[n:n+1], "=")
@@ -48,7 +48,7 @@
envdup()
idx = 0
- for envp in environ
+ for envp : environ
env = cstrconvp(envp)
n = min(name.len, env.len)
if sleq(name, env[:n]) && sleq(env[n:n+1], "=")
--- a/lib/std/execvp.myr
+++ b/lib/std/execvp.myr
@@ -21,7 +21,7 @@
-> execv(cmd, args)
| `None:
paths = getpaths()
- for p in paths
+ for p : paths
binpath = bfmt(buf[:], "{}/{}", p, cmd)
execv(binpath, args)
;;
@@ -39,7 +39,7 @@
-> execve(cmd, args, env)
| `None:
paths = getpaths()
- for p in paths
+ for p : paths
binpath = bfmt(buf[:], "{}/{}", p, cmd)
execve(binpath, args, env)
;;
--- a/lib/std/fltbits.myr
+++ b/lib/std/fltbits.myr
@@ -24,9 +24,9 @@
var bits, isneg, mant, exp
bits = flt64bits(flt)
- isneg = (bits >> 63) != 0 /* msb is sign bit */
+ isneg = (bits >> 63) != 0 /* msb is sign bit */
exp = (bits >> 52) & 0x7ff /* exp is in bits [52..63] */
- mant = bits & ((1l << 52) - 1) /* msb is in bits [..51] */
+ mant = bits & ((1l << 52) - 1) /* msb is in bits [..51] */
/* add back the implicit bit if this is not a denormal */
if exp != 0
@@ -47,9 +47,9 @@
var bits, isneg, mant, exp
bits = flt32bits(flt)
- isneg = (bits >> 31) != 0 /* msb is sign bit */
- exp = (bits >> 22) & 0xff /* exp is in bits [23..30] */
- mant = bits & ((1 << 22) - 1) /* msb is in bits [0..22] */
+ isneg = (bits >> 31) != 0 /* msb is sign bit */
+ exp = (bits >> 22) & 0xff /* exp is in bits [23..30] */
+ mant = bits & ((1 << 22) - 1) /* msb is in bits [0..22] */
/* add back the implicit bit if this is not a denormal */
if exp != 0
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -216,7 +216,7 @@
std.fatal("invalid format options {}\n")
;;
params = strsplit(paramstr, ",")
- for p in params
+ for p : params
/* parse out the key/value pair */
match std.strfind(p, "=")
| `std.Some idx:
@@ -231,7 +231,7 @@
found = false
/* verify and add the arg */
- for (opt, hasarg) in optdesc
+ for (opt, hasarg) : optdesc
if !std.sleq(opt, o)
continue
;;
@@ -245,7 +245,7 @@
;;
if !found
std.put("options: \n")
- for (opt, hasarg) in optdesc
+ for (opt, hasarg) : optdesc
std.put("\t'{}', hasarg={}\n", opt, hasarg)
;;
std.fatal("invalid option '{}' ", o)
@@ -427,7 +427,7 @@
][:])
join = ", "
joined = false
- for o in opts
+ for o : opts
match o
| ("j", j):
joined = true
@@ -483,7 +483,7 @@
("x", false),
("w", true),
("p", true)][:])
- for o in opts
+ for o : opts
match o
| ("x", ""): ip.base = 16
| ("w", wid): ip.padto = getint(wid, "fmt: width must be integer")
@@ -511,7 +511,7 @@
("e", false),
][:])
- for o in opts
+ for o : opts
match o
| ("w", wid): w = getint(wid, "fmt: width must be integer")
| ("p", pad): p = decode(pad)
@@ -523,7 +523,7 @@
iassert(p >= 0, "pad must be >= 0")
std.slfree(opts)
if raw
- for b in str
+ for b : str
if esc
sbputs(sb, "\\x")
;;
@@ -530,7 +530,7 @@
intfmt(sb, [.padto=2, .padfill='0', .base=16], false, b)
;;
elif esc
- for b in str
+ for b : str
if isprint(b)
sbputb(sb, b)
else
--- a/lib/std/intparse.myr
+++ b/lib/std/intparse.myr
@@ -52,7 +52,7 @@
var cv : int32
v = 0
- for c in std.bychar(s)
+ for c : std.bychar(s)
if c == '_'
continue
;;
--- a/lib/std/optparse.myr
+++ b/lib/std/optparse.myr
@@ -153,7 +153,7 @@
}
const optinfo = {ctx, opt
- for o in ctx.optdef.opts
+ for o : ctx.optdef.opts
if o.opt == opt
-> `Some (o.arg.len != 0, !o.optional, o.dest)
;;
@@ -189,13 +189,13 @@
sb = mksb()
std.sbfmt(sb, "usage: {} [-h?", prog)
- for o in def.opts
+ for o : def.opts
if o.arg.len == 0
std.sbfmt(sb, "{}", o.opt)
;;
;;
std.sbfmt(sb, "] ")
- for o in def.opts
+ for o : def.opts
if o.arg.len != 0
std.sbfmt(sb, "[-{} {}] ", o.opt, o.arg)
;;
@@ -203,7 +203,7 @@
std.sbfmt(sb, "{}\n", def.argdesc)
std.sbfmt(sb, "\t-h\tprint this help message\n")
std.sbfmt(sb, "\t-?\tprint this help message\n")
- for o in def.opts
+ for o : def.opts
std.sbfmt(sb, "\t-{}{}{}\t{}\n", o.opt, sep(o.arg), o.arg, o.desc)
;;
s = sbfin(sb)
--- a/lib/std/pathjoin.myr
+++ b/lib/std/pathjoin.myr
@@ -42,7 +42,7 @@
/*
"." is a no-op component, so we drop it. In order
to drop a component, we set it to the empty string,
- and remove it later on in the code.
+ and remove it later on.
*/
for i = 0; i < comps.len; i++
if sleq(comps[i], ".")
--- a/lib/std/resolve+posixy.myr
+++ b/lib/std/resolve+posixy.myr
@@ -123,7 +123,7 @@
;;
lines = strsplit(h, "\n")
- for l in lines
+ for l : lines
/* trim comment */
match strfind(l, "#")
| `Some idx: l = l[:idx]
@@ -190,7 +190,7 @@
;;
lines = strsplit(h, "\n")
- for l in lines
+ for l : lines
match strfind(l, "#")
| `Some _idx: l = l[:_idx]
| `None:
@@ -247,7 +247,7 @@
-> `Err (`Badhost)
;;
/* FIXME: Assumption: nameservers is not modified by other threads */
- for ns in nameservers
+ for ns : nameservers
nsrv = dnsconnect(ns)
if nsrv >= 0
r = dnsquery(nsrv, host, rt)
--- a/lib/std/slpush.myr
+++ b/lib/std/slpush.myr
@@ -10,9 +10,9 @@
slpush relies on implementation details
of slgrow for efficiency. Because bucket
sizes come in powers of two for all buckets
- <= 32k, and we only reallocate when we hit
- a bucket boundary, this is effectively
- growing the slice by powers of two.
+ <= 32k, and by powers of 1.5 for larger
+ slices, this is effectively growing the
+ slice by powers of two.
*/
slgrow(sl, sl#.len + 1)
sl#[sl#.len - 1] = elt
--- a/lib/std/test/bitset.myr
+++ b/lib/std/test/bitset.myr
@@ -36,7 +36,7 @@
std.bsput(bs, 16)
std.bsput(bs, 7)
std.bsput(bs, 3)
- for e in std.bybsvalue(bs)
+ for e : std.bybsvalue(bs)
testr.check(ctx, e == expected[i], "expected[{}] ({}) != {}", i, e, expected[i])
i++
;;
@@ -63,7 +63,7 @@
var bs
bs = std.mkbs()
- for e in elts
+ for e : elts
std.bsput(bs, e)
;;
-> bs
--- a/lib/std/test/bytealloc.myr
+++ b/lib/std/test/bytealloc.myr
@@ -3,9 +3,9 @@
const main = {
var a : byte#[1000]
- for sz in [10, 100, 1000, 10000, 10000]
+ for sz : [10, 100, 1000, 10000, 10000]
std.put("sz: {}\n", sz)
- for cnt in [1, 10, 100]
+ for cnt : [1, 10, 100]
std.put("cnt: {}\n", cnt)
/* alloc forwards, dealloc forwards */
for var i = 0; i < cnt; i++
--- a/lib/std/test/fmt.myr
+++ b/lib/std/test/fmt.myr
@@ -154,7 +154,7 @@
x = std.vanext(ap)
std.sbfmt(sb, "formatted a pair: [{}, {}]", x.x, x.y)
- for opt in opts
+ for opt : opts
std.sbputc(sb, ' ')
match opt
| ("x", val): std.sbfmt(sb, "x={}", val)
--- a/lib/std/test/ipparse.myr
+++ b/lib/std/test/ipparse.myr
@@ -69,11 +69,11 @@
if !std.sleq(p, e)
std.fput(1, "misparsed ip {}\n", ip)
std.put("parsed: ")
- for b in p
+ for b : p
std.put("{x}, ", b)
;;
std.put("\nexpected: ")
- for b in e
+ for b : e
std.put("{x}, ", b)
;;
std.put("\n")
--- a/lib/std/test/iterutil.myr
+++ b/lib/std/test/iterutil.myr
@@ -4,7 +4,7 @@
var n
n = 0
- for (x, i) in std.byenum([1,3,5,7,9][:])
+ for (x, i) : std.byenum([1,3,5,7,9][:])
std.assert(x == n, "invalid enum idx {}", x)
std.assert(i == n*2 + 1, "invalid enum val {}", i)
n++
@@ -11,7 +11,7 @@
;;
n = 0
- for (a, b) in std.byzip([0,2,4,6,8][:], [2,4][:])
+ for (a, b) : std.byzip([0,2,4,6,8][:], [2,4][:])
std.assert(a == n*2, "invalid val from a: {}", a)
std.assert(b == n*2 + 2, "invalid val from b: {}", b)
n++
@@ -18,7 +18,7 @@
;;
n = 0
- for x in std.byreverse([3, 2, 1, 0][:])
+ for x : std.byreverse([3, 2, 1, 0][:])
std.assert(x == n, "invalid reversed value {}, expected {}", x, n)
n++
;;
--- a/lib/std/test/striter.myr
+++ b/lib/std/test/striter.myr
@@ -6,13 +6,13 @@
var i
i = 0
- for c in std.bychar("abc")
+ for c : std.bychar("abc")
std.assert(chars[i++] == c, "wrong char")
;;
std.assert(i == chars.len, "wrong split count")
i = 0
- for sp in std.bysplit("foo+++bar", "++")
+ for sp : std.bysplit("foo+++bar", "++")
std.assert(std.streq(splits[i++], sp), "wrong split {}", sp)
;;
std.assert(i == splits.len, "wrong split count")
--- a/lib/sys/sys+freebsd-x64.myr
+++ b/lib/sys/sys+freebsd-x64.myr
@@ -108,10 +108,10 @@
type utsname = struct
system : byte[32]
- node : byte[32]
- release : byte[32]
- version : byte[32]
- machine : byte[32]
+ node : byte[32]
+ release : byte[32]
+ version : byte[32]
+ machine : byte[32]
;;
type sockaddr = struct
@@ -146,9 +146,9 @@
type sockaddr_storage = struct
len : byte
fam : sockfam
- __pad1 : byte[6]
- __align : int64
- __pad2 : byte[112]
+ __pad1 : byte[6]
+ __align : int64
+ __pad2 : byte[112]
;;
type dirent = struct
@@ -304,25 +304,25 @@
const Maxpathlen : size = 1024
/* fcntl constants */
- const Fdupfd : fcntlcmd = 0 /* duplicate file descriptor */
- const Fgetfd : fcntlcmd = 1 /* get file descriptor flags */
- const Fsetfd : fcntlcmd = 2 /* set file descriptor flags */
- const Fgetfl : fcntlcmd = 3 /* get file status flags */
- const Fsetfl : fcntlcmd = 4 /* set file status flags */
- const Fgetown : fcntlcmd = 5 /* get SIGIO/SIGURG proc/pgrp */
- const Fsetown : fcntlcmd = 6 /* set SIGIO/SIGURG proc/pgrp */
- const Fogetlk : fcntlcmd = 7 /* get record locking information */
- const Fosetlk : fcntlcmd = 8 /* set record locking information */
- const Fosetlkw : fcntlcmd = 9 /* F_SETLK; wait if blocked */
- const Fdup2fd : fcntlcmd = 10 /* duplicate file descriptor to arg */
- const Fgetlk : fcntlcmd = 11 /* get record locking information */
- const Fsetlk : fcntlcmd = 12 /* set record locking information */
- const Fsetlkw : fcntlcmd = 13 /* F_SETLK; wait if blocked */
- const Fsetlk_remote : fcntlcmd = 14 /* debugging support for remote locks */
- const Freadahead : fcntlcmd = 15 /* read ahead */
- const Frdahead : fcntlcmd = 16 /* Darwin compatible read ahead */
- const Fdupfd_cloexec : fcntlcmd = 17 /* Like F_DUPFD, but FD_CLOEXEC is set */
- const Fdup2fd_cloexec : fcntlcmd = 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */
+ const Fdupfd : fcntlcmd = 0 /* duplicate file descriptor */
+ const Fgetfd : fcntlcmd = 1 /* get file descriptor flags */
+ const Fsetfd : fcntlcmd = 2 /* set file descriptor flags */
+ const Fgetfl : fcntlcmd = 3 /* get file status flags */
+ const Fsetfl : fcntlcmd = 4 /* set file status flags */
+ const Fgetown : fcntlcmd = 5 /* get SIGIO/SIGURG proc/pgrp */
+ const Fsetown : fcntlcmd = 6 /* set SIGIO/SIGURG proc/pgrp */
+ const Fogetlk : fcntlcmd = 7 /* get record locking information */
+ const Fosetlk : fcntlcmd = 8 /* set record locking information */
+ const Fosetlkw : fcntlcmd = 9 /* F_SETLK; wait if blocked */
+ const Fdup2fd : fcntlcmd = 10 /* duplicate file descriptor to arg */
+ const Fgetlk : fcntlcmd = 11 /* get record locking information */
+ const Fsetlk : fcntlcmd = 12 /* set record locking information */
+ const Fsetlkw : fcntlcmd = 13 /* F_SETLK; wait if blocked */
+ const Fsetlk_remote : fcntlcmd = 14 /* debugging support for remote locks */
+ const Freadahead : fcntlcmd = 15 /* read ahead */
+ const Frdahead : fcntlcmd = 16 /* Darwin compatible read ahead */
+ const Fdupfd_cloexec : fcntlcmd = 17 /* Like F_DUPFD, but FD_CLOEXEC is set */
+ const Fdup2fd_cloexec : fcntlcmd = 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */
/* return value for a failed mapping */
const Mapbad : byte# = (-1 : byte#)
--- a/lib/sys/sys+netbsd-x64.myr
+++ b/lib/sys/sys+netbsd-x64.myr
@@ -90,7 +90,7 @@
mtime : timespec /* time of last data modification */
ctime : timespec /* time of last file status change */
btime : timespec /* time of creation */
- size : uint64 /* file size, in bytes */
+ size : uint64 /* file size in bytes */
blocks : uint64 /* blocks allocated for file */
blksize : uint32 /* optimal blocksize for I/O */
flags : uint32 /* user defined flags for file */
--- a/lib/testr/testr.myr
+++ b/lib/testr/testr.myr
@@ -22,7 +22,7 @@
const run = {specs
std.put("MTEST {}\n", specs.len)
- for s in specs
+ for s : specs
runspec(&s)
;;
}
--- a/mbld/build.myr
+++ b/mbld/build.myr
@@ -16,7 +16,7 @@
;;
const buildall = {b
- for tn in b.all
+ for tn : b.all
if std.hthas(b.built, tn)
continue
;;
@@ -42,7 +42,7 @@
depset = std.mkht(std.strhash, std.streq)
addeps(b, targ, depset)
- for tn in b.all
+ for tn : b.all
if std.hthas(b.built, tn) || !std.hthas(depset, tn)
continue
;;
@@ -75,11 +75,11 @@
std.htput(depset, targ, true)
match gettarg(b.targs, targ)
| `Bin bt:
- for (dir, lib, targname) in bt.libdeps
+ for (dir, lib, targname) : bt.libdeps
addeps(b, targname, depset)
;;
| `Lib lt:
- for (dir, lib, targname) in lt.libdeps
+ for (dir, lib, targname) : lt.libdeps
addeps(b, targname, depset)
;;
| _:
@@ -87,7 +87,7 @@
}
const genall = {b
- for tn in b.all
+ for tn : b.all
match gettarg(b.targs, tn)
| `Gen gt: runin(b, gt.cmd, gt.dir)
| _: /* skip */
@@ -173,7 +173,7 @@
const genfiles = {b, gt
setdir(b, gt.dir)
- for out in gt.out
+ for out : gt.out
if !std.fexists(out) || !allfresh(gt.deps, out)
run(gt.cmd)
break
@@ -182,7 +182,7 @@
}
const addincludes = {b, targ
- for (inc, lib, subtarg) in targ.libdeps
+ for (inc, lib, subtarg) : targ.libdeps
if !hasinc(targ.incpath, inc)
std.slput(&targ.incpath, 0, inc)
;;
@@ -190,7 +190,7 @@
}
const hasinc = {path, t
- for e in path
+ for e : path
if std.sleq(e, t)
-> true
;;
@@ -210,7 +210,7 @@
match std.htget(dg.deps, out)
| `std.Some deps:
- for d in deps
+ for d : deps
if std.sleq(out, d)
/*
if an input generates itself (eg, object files), we
@@ -259,7 +259,7 @@
cmd = [][:]
if std.hassuffix(src, ".myr")
std.slpush(&cmd, opt_mc)
- for inc in incs
+ for inc : incs
std.slpush(&cmd, "-I")
std.slpush(&cmd, inc)
;;
@@ -271,7 +271,7 @@
std.slfree(cmd)
elif std.hassuffix(src, ".s")
o = srcswapsuffix(src, config.Objsuffix)
- for c in config.Ascmd
+ for c : config.Ascmd
std.slpush(&cmd, c)
;;
std.slpush(&cmd,"-o")
@@ -286,7 +286,7 @@
std.slpush(&cmd,"-o")
std.slpush(&cmd, o)
std.slpush(&cmd, src)
- for flg in std.htgetv(dg.cflags, src, [][:])
+ for flg : std.htgetv(dg.cflags, src, [][:])
std.slpush(&cmd, flg)
;;
run(cmd)
@@ -303,7 +303,7 @@
cmd = [][:]
/* ld -o bin */
- for c in config.Linkcmd
+ for c : config.Linkcmd
std.slpush(&cmd, std.sldup(c))
;;
std.slpush(&cmd, std.sldup(bin))
@@ -323,7 +323,7 @@
;;
/* input.o list.o... */
- for f in srcfiles
+ for f : srcfiles
std.slpush(&cmd, srcswapsuffix(f, config.Objsuffix))
;;
@@ -332,7 +332,7 @@
/* add extra libs */
- for l in dg.extlibs
+ for l : dg.extlibs
std.slpush(&cmd, std.fmt("-l{}", l))
;;
@@ -354,11 +354,11 @@
var obj
cmd = [][:]
- for c in config.Arcmd
+ for c : config.Arcmd
std.slpush(&cmd, std.sldup(c))
;;
std.slpush(&cmd, std.fmt("lib{}.a", lib))
- for f in files
+ for f : files
obj = srcswapsuffix(f, config.Objsuffix)
std.slpush(&cmd, obj)
;;
@@ -375,7 +375,7 @@
std.slpush(&cmd, std.fmt("lib{}.use", lib))
std.slpush(&cmd, std.sldup("-p"))
std.slpush(&cmd, std.sldup(lib))
- for f in files
+ for f : files
if std.hassuffix(f, ".myr")
std.slpush(&cmd, srcswapsuffix(f, ".use"))
elif !std.hassuffix(f, ".s") && !std.hassuffix(f, ".glue.c")
@@ -382,7 +382,7 @@
std.fatal("unknown file type for {}\n", f)
;;
;;
- for l in dg.extlibs
+ for l : dg.extlibs
std.slpush(&cmd, std.fmt("-l{}", l))
;;
run(cmd)
@@ -397,7 +397,7 @@
/* -L incpath... */
if !config.Directlib
- for inc in incs
+ for inc : incs
std.slpush(&cmd, std.fmt("-L{}", inc))
;;
;;
@@ -407,7 +407,7 @@
marked = std.mkht(std.strhash, std.streq)
head = cmd.len
- for lib in libs
+ for lib : libs
cmd = visit(cmd, head, libgraph, lib, looped, marked, incs)
;;
@@ -422,7 +422,7 @@
;;
std.htput(looped, lib, true)
- for dep in std.htgetv(g, lib, [][:])
+ for dep : std.htgetv(g, lib, [][:])
cmd = visit(cmd, head, g, dep, looped, marked, incs)
;;
std.htdel(looped, lib)
@@ -440,7 +440,7 @@
| `std.None:
mbldput("in path: ")
sep = ""
- for inc in incs
+ for inc : incs
mbldput("\t{}{}\n", sep, inc)
sep = ", "
;;
@@ -456,7 +456,7 @@
var sl, p
sl = std.bfmt(buf[:], "lib{}.a", lib)
- for i in incs
+ for i : incs
p = std.pathcat(i, sl)
if std.fexists(p)
-> `std.Some p
@@ -476,7 +476,7 @@
var libs
libs = std.htkeys(libgraph)
- for l in libs
+ for l : libs
match findlib(l, targ.incpath)
| `std.Some lib:
if !isfresh(lib, output)
@@ -487,7 +487,7 @@
| `std.None:
std.fput(1, "{}: could not find library lib{}.a\n", targ.name, l)
std.fput(1, "searched:\n")
- for inc in targ.incpath
+ for inc : targ.incpath
std.fput(1, "\t{}\n", inc)
;;
std.fput(1, "\t{}/{}\n", opt_instbase, config.Libpath)
@@ -499,7 +499,7 @@
}
const allfresh = {deps, out
- for d in deps
+ for d : deps
if !isfresh(d, out)
-> false
;;
--- a/mbld/clean.myr
+++ b/mbld/clean.myr
@@ -14,7 +14,7 @@
;;
const cleanall = {b
- for tn in b.all
+ for tn : b.all
match gettarg(b.targs, tn)
| `Bin bt:
cleanup(b, bt, bt.inputs)
@@ -21,7 +21,7 @@
| `Lib lt:
cleanup(b, lt, lt.inputs)
| `Gen gt:
- for f in gt.out
+ for f : gt.out
if !gt.durable && std.remove(f)
mbldput("\tclean {}\n", f)
;;
@@ -35,7 +35,7 @@
}
const clean = {b, targ
- for tn in b.all
+ for tn : b.all
match gettarg(b.targs, tn)
| `Bin bt:
if std.sleq(bt.name, targ)
@@ -46,7 +46,7 @@
cleanup(b, lt, lt.inputs)
;;
| `Gen gt:
- for f in gt.out
+ for f : gt.out
if !gt.durable && std.remove(f)
mbldput("\tclean {}\n", f)
;;
@@ -74,12 +74,12 @@
setdir(b, targ.dir)
dg = myrdeps(b, targ, true, true)
mchammer_files = std.mkht(std.strhash, std.streq)
- for l in leaves
+ for l : leaves
std.htput(mchammer_files, l, true)
;;
keys = std.htkeys(dg.deps)
- for k in keys
+ for k : keys
if !std.htgetv(mchammer_files, k, false) && std.remove(k)
mbldput("\tclean {}\n", k)
;;
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -111,7 +111,7 @@
var sl
sl = [][:]
- for s in srcs
+ for s : srcs
std.slpush(&sl, srcswapsuffix(s, suff))
;;
-> sl
@@ -125,8 +125,8 @@
;;
keys = std.htkeys(dg.deps)
mbldput("digraph dg {{\n")
- for k in keys
- for v in std.htgetv(dg.deps, k, ["WTFUNKNOWN!"][:])
+ for k : keys
+ for v : std.htgetv(dg.deps, k, ["WTFUNKNOWN!"][:])
mbldput("\t\"{}\" -> \"{}\";\n", k, v)
;;
;;
@@ -143,7 +143,7 @@
std.slpush(&ds.depstk, path)
if std.htgetv(g.seen, path, false)
std.fput(1, "dependency loop involving {}:\n", path)
- for d in ds.depstk
+ for d : ds.depstk
std.fput(1, "\t{}\n", d)
;;
std.exit(1)
@@ -150,7 +150,7 @@
;;
deps = getdeps(b, ds, path, std.dirname(path))
std.htput(g.seen, path, true)
- for d in deps
+ for d : deps
match d
| `Lib (lib, lnum):
/*
@@ -233,7 +233,7 @@
| `std.None:
| `std.Some m:
flags = std.strtok(m[1])
- for fl in flags
+ for fl : flags
std.slpush(&cflags, std.sldup(fl))
;;
std.slfree(flags)
@@ -244,7 +244,7 @@
| `std.None:
| `std.Some m:
flags = std.strtok(m[1])
- for fl in flags
+ for fl : flags
std.slpush(&libs, std.sldup(fl))
;;
std.slfree(flags)
@@ -358,7 +358,7 @@
;;
bio.close(f)
std.htput(dg.libs, lib, deps)
- for dep in deps
+ for dep : deps
scrapelibs(dg, dep, incs)
;;
}
@@ -366,7 +366,7 @@
const openlib = {lib, incs
var path, libname
- for p in incs
+ for p : incs
libname = std.fmt("lib{}.use", lib)
path = std.pathjoin([p, libname][:])
std.slfree(libname)
@@ -399,7 +399,7 @@
;;
std.fput(std.Err, "could not find library {}\n", lib)
std.fput(std.Err, "search path is:\n")
- for p in incs
+ for p : incs
std.fput(std.Err, "\t{}\n", p)
;;
std.fput(std.Err, "\t{}\n", config.Libpath)
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -26,7 +26,7 @@
var libarchive, libuse
var pfx
- for tn in b.all
+ for tn : b.all
match gettarg(b.targs, tn)
| `Bin bt:
if bt.install && !bt.istest
@@ -42,7 +42,7 @@
std.slfree(libuse)
;;
| `Data dt:
- for blob in dt.blobs
+ for blob : dt.blobs
if dt.path.len == 0
pfx = std.pathcat(config.Sharepath, dt.name)
movefile(b, rm, dt.dir, blob, pfx, 0o644)
@@ -57,7 +57,7 @@
/* nothing to do */
| `Man mt:
/* FIXME: figure out man section by number */
- for m in mt.pages
+ for m : mt.pages
moveman(b, rm, mt.dir, m)
;;
;;
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -46,7 +46,7 @@
ok = true
bld.initopts()
- for opt in cmd.opts
+ for opt : cmd.opts
match opt
| ('S', ""): bld.opt_genasm = true
| ('I', arg): std.slpush(&bld.opt_incpaths, arg)
@@ -77,7 +77,7 @@
;;
;;
- for (e, v) in config.Env
+ for (e, v) : config.Env
std.setenv(e, v)
;;
@@ -100,7 +100,7 @@
if cmd.args.len == 0
bld.buildall(b)
else
- for c in cmd.args
+ for c : cmd.args
match c
| "all": r = bld.buildall(b)
| "gen": r = bld.genall(b)
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -84,7 +84,7 @@
i = 0
a = [0, 0, 0]
- for e in std.bysplit(v, ".")
+ for e : std.bysplit(v, ".")
match std.intparse(e)
| `std.Some n: a[i++] = n
| `std.None: continue
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -43,7 +43,7 @@
ok = loadall(b, b.bldfile, "", sel)
targs = sysselfin(sel)
- for (name, targ) in targs
+ for (name, targ) : targs
std.slpush(&b.all, name)
std.htput(b.targs, name, targ)
;;
@@ -62,11 +62,11 @@
p = mkparser(path, dir, b.basedir, sel)
ok = bld.parse(b, p, "")
- for t in p.targs
+ for t : p.targs
setopts(p, t)
;;
- for sub in p.subdirs
+ for sub : p.subdirs
subbld = std.pathcat(sub, "bld.sub")
subproj = std.pathcat(sub, "bld.proj")
/*
@@ -115,11 +115,11 @@
;;
std.sljoin(&t.incpath, p.incpath)
- for l in p.libdeps
+ for l : p.libdeps
libdep = libpath(p, l)
std.slpush(&t.libdeps, libdep)
;;
- for l in p.tstdeps
+ for l : p.tstdeps
tstdep = libpath(p, l)
std.slpush(&t.tstdeps, tstdep)
;;
@@ -206,7 +206,7 @@
all = [][:]
looped = std.mkht(std.strhash, std.streq)
marked = std.mkht(std.strhash, std.streq)
- for dep in b.all
+ for dep : b.all
match gettarg(b.targs, dep)
| `Bin _: all = visit(all, b, "all", dep, looped, marked)
| `Lib _: all = visit(all, b, "all", dep, looped, marked)
@@ -226,7 +226,7 @@
;;
std.htput(looped, targ, true)
- for (dir, lib, dep) in getdeps(b, parent, targ)
+ for (dir, lib, dep) : getdeps(b, parent, targ)
all = visit(all, b, targ, dep, looped, marked)
;;
std.htdel(looped, targ)
@@ -311,7 +311,7 @@
var subs
subs = anontarget(p, "sub")
- for s in subs
+ for s : subs
std.slpush(&p.subdirs, std.pathcat(p.fdir, s))
;;
}
@@ -361,7 +361,7 @@
istest = false
deplist = [][:]
tags = [][:]
- for elt in attrs
+ for elt : attrs
match elt
| ("durable", ""): durable = true
| ("test", ""): istest = true
@@ -384,7 +384,7 @@
.cmd=cmdlist,
.tags=tags,
])
- for o in outlist
+ for o : outlist
if iscmd
addtarg(p, b, o, gt.tags, `Cmd gt)
else
@@ -429,7 +429,7 @@
match inputlist(p)
| `std.Some (wl, libs):
libdeps = libs
- for w in wl
+ for w : wl
sysseladd(fsel, w)
;;
inputs = sysselfin(fsel)
@@ -449,7 +449,7 @@
tags = [][:]
istest = false
tstdeps = [][:]
- for elt in attrs
+ for elt : attrs
match elt
| ("ldscript", lds): ldscript = std.sldup(lds)
| ("runtime", rt): runtime = std.sldup(rt)
@@ -519,7 +519,7 @@
;;
tags = [][:]
- for elt in attrs
+ for elt : attrs
match elt
| ("tag", tag): std.slpush(&tags, tag)
| ("path", pathdir): path = pathdir
--- a/mbld/subtest.myr
+++ b/mbld/subtest.myr
@@ -75,7 +75,7 @@
curtest = ""
nresults = 0
mbldput("\n")
- for ln in bio.byline(f)
+ for ln : bio.byline(f)
ln = std.strstrip(ln)
match testhead(ln)
| `std.None:
@@ -127,7 +127,7 @@
const starttest = {curtest, t
if curtest#.len != 0
- std.fatal("malformed input: test {} nested in {}\n", t, curtest)
+ std.fatal("malformed input in test {} nested : {}\n", t, curtest)
;;
mbldput("\trun {}:\t", std.strstrip(t))
curtest# = t
--- a/mbld/syssel.myr
+++ b/mbld/syssel.myr
@@ -63,7 +63,7 @@
var nmatch, curbest, n, v
nmatch = 0
- for a in attrs
+ for a : attrs
match std.strfind(a, ":")
| `std.Some i:
n = a[:i]
@@ -106,7 +106,7 @@
keys = std.htkeys(syssel._match)
ret = [][:]
- for k in keys
+ for k : keys
nmatch = std.htgetv(syssel._match, k, -1)
if nmatch == -1
std.fatal("{}:{}: target {}, no applicable file for '{}'\n", \
@@ -192,7 +192,7 @@
}
const tag = {sa, tags
- for t in tags
+ for t : tags
std.htput(sa, t, (-1, -1, -1))
;;
}
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -27,7 +27,7 @@
tests = [][:]
buildall(b)
setdir(b, "")
- for tn in b.all
+ for tn : b.all
match gettarg(b.targs, tn)
| `Bin bt: std.sljoin(&tests, buildtests(b, bt))
| `Lib lt: std.sljoin(&tests, buildtests(b, lt))
@@ -34,7 +34,7 @@
| _: /* nothing */
;;
;;
- for tn in b.all
+ for tn : b.all
match gettarg(b.targs, tn)
| `Bin t:
if !t.istest
@@ -58,7 +58,7 @@
ok = true
failed = [][:]
- for (c, dir) in tests
+ for (c, dir) : tests
setdir(b, dir)
if !runtest(b, c, &failed)
ok = false
@@ -65,7 +65,7 @@
;;
;;
- for (bin, dir) in tests
+ for (bin, dir) : tests
freecmd(bin)
std.slfree(dir)
;;
@@ -74,7 +74,7 @@
;;
printfailed(failed)
- for f in failed
+ for f : failed
std.slfree(f)
;;
if ok
@@ -90,7 +90,7 @@
const printfailed = {failed
if failed.len > 0
mbldput("FAILURES: {}\n", failed.len)
- for t in failed
+ for t : failed
mbldput("\t{}\n", t)
;;
;;
@@ -100,7 +100,7 @@
var ret
ret = [][:]
- for c in cmd
+ for c : cmd
std.slpush(&ret, std.sldup(c))
;;
-> ret
@@ -107,7 +107,7 @@
}
const freecmd = {cmd
- for c in cmd
+ for c : cmd
std.slfree(c)
;;
std.slfree(cmd)
@@ -119,7 +119,7 @@
tests = [][:]
setdir(b, targ.dir)
- for s in targ.inputs
+ for s : targ.inputs
match testpath(s)
| `std.None: /* nothing to do */
| `std.Some path:
@@ -152,7 +152,7 @@
var sub
mbldput("run")
- for c in cmd
+ for c : cmd
p = std.pathcat(b.curdir, c)
mbldput(" {}", p)
std.slfree(p)
--- a/mbld/util.myr
+++ b/mbld/util.myr
@@ -51,7 +51,7 @@
if lst.len > 0
mbldput("\t")
mbldput("{}\t", lst[0])
- for l in lst[1:]
+ for l : lst[1:]
mbldput("{} ", l)
;;
;;
@@ -111,7 +111,7 @@
}
const strlistfree = {sl
- for s in sl
+ for s : sl
std.slfree(s)
;;
std.slfree(sl)
--- a/support/dumpleak.myr
+++ b/support/dumpleak.myr
@@ -25,7 +25,7 @@
][:]
])
- for opt in cmd.opts
+ for opt : cmd.opts
match opt
| ('d', depth):
match std.intparse(depth)
@@ -39,7 +39,7 @@
;;
stats.tab = std.mkht(std.inthash, std.inteq)
- for d in cmd.args
+ for d : cmd.args
match bio.open(d, bio.Rd)
| `std.Ok f: dump(d, f, &stats)
| `std.Err e: std.fatal("could not open {}: {}\n", d, e)
@@ -100,7 +100,7 @@
var aggr
aggr = std.mkht(hashintsl, std.sleq)
- for (k, (sz, stk)) in std.byhtkeyvals(tab)
+ for (k, (sz, stk)) : std.byhtkeyvals(tab)
match std.htget(aggr, stk[:stackaggr])
| `std.Some (count, total):
std.htput(aggr, stk[:stackaggr], (count + 1, sz + total))
@@ -109,7 +109,7 @@
;;
;;
- for (stk, (n, sz)) in std.byhtkeyvals(aggr)
+ for (stk, (n, sz)) : std.byhtkeyvals(aggr)
std.put("unfreed: {} (size: {}): {}\n", n, sz, stk)
;;
}
@@ -125,7 +125,7 @@
var h
h = 0
- for i in sl
+ for i : sl
h ^= std.inthash(i)
;;
-> h
--- a/test/arraypack.myr
+++ b/test/arraypack.myr
@@ -8,7 +8,7 @@
]
const main = {
- for x in a[:]
+ for x : a[:]
std.put("{}", x)
;;
std.put("\n")
--- a/test/constslice.myr
+++ b/test/constslice.myr
@@ -7,15 +7,15 @@
const main = {
/* expected output 23 */
- for x in slpart
+ for x : slpart
std.put("{}", x)
;;
/* expected output 12345 */
- for x in slfull
+ for x : slfull
std.put("{}", x)
;;
/* expected output 678 */
- for x in slinline
+ for x : slinline
std.put("{}", x)
;;
std.put("\n")
--- a/test/custiter.myr
+++ b/test/custiter.myr
@@ -25,7 +25,7 @@
var x : int
r = [.lo=6, .hi=11]
- for v in r
+ for v : r
x = v
std.put("{}", x)
;;
--- a/test/empty-struct.myr
+++ b/test/empty-struct.myr
@@ -14,11 +14,11 @@
var z : foo[0]
var b : bar = [.baz = [a, a][:], .quux = [z, z, z][:]]
var c : int = 0
- for f in b.baz
+ for f : b.baz
c += 3
;;
- for f in b.quux
+ for f : b.quux
c += 5
;;
--- a/test/encodechar.myr
+++ b/test/encodechar.myr
@@ -11,7 +11,7 @@
var buf : byte[32]
s = "1世界äa\n"
- for c in std.bychar(s)
+ for c : std.bychar(s)
foo = c
if std.encode(buf[:std.charlen(c)], c) == 0
std.write(1, "couldn't encode\n")
--- a/test/patiter.myr
+++ b/test/patiter.myr
@@ -2,11 +2,11 @@
const main = {
/* should print 1,3,5, skipping 4 */
- for (1,x) in [(1,2),(1,3),(2,4),(1,5)]
+ for (1,x) : [(1,2),(1,3),(2,4),(1,5)]
std.put("{}", x)
;;
/* should print 1, 2 skipping `None */
- for `std.Some v in [`std.None, `std.Some 1, `std.Some 2]
+ for `std.Some v : [`std.None, `std.Some 1, `std.Some 2]
std.put("{}", v)
;;
std.put("\n")
--- a/test/subrangefor.myr
+++ b/test/subrangefor.myr
@@ -1,7 +1,7 @@
use std
const main = {
- for i in [1,2,3,4][:2]
+ for i : [1,2,3,4][:2]
std.put("{}", i)
;;
std.put("\n")
--- a/test/uconinit.myr
+++ b/test/uconinit.myr
@@ -9,7 +9,7 @@
const a = [`A, `B, `C 123]
const main = {
- for v in a
+ for v : a
match v
| `A: std.put("A ")
| `B: std.put("B ")