summaryrefslogtreecommitdiff
path: root/lib/regex
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2017-07-17 15:30:01 -0700
committerOri Bernstein <ori@markovcorp.com>2017-07-17 15:30:01 -0700
commit492aca3ff6f829ee09c52e17c86a808430ee7df4 (patch)
treef97424e14c9d3277c78ff53082daec725e1f4dcb /lib/regex
parent11f79ed8ff75049f6b1866d70bc032c8d18b1463 (diff)
downloadmc-492aca3ff6f829ee09c52e17c86a808430ee7df4.tar.gz
Convert from `in` to `:`.
The winds of change are a-blowin.
Diffstat (limited to 'lib/regex')
-rw-r--r--lib/regex/compile.myr14
-rw-r--r--lib/regex/interp.myr2
-rw-r--r--lib/regex/redump.myr6
3 files changed, 11 insertions, 11 deletions
diff --git a/lib/regex/compile.myr b/lib/regex/compile.myr
index 5228d08..edfa3aa 100644
--- a/lib/regex/compile.myr
+++ b/lib/regex/compile.myr
@@ -85,7 +85,7 @@ const free = {re
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 @@ const genranges = {re, sl, ast
/* 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 rtinsert = {rt, lo, hi
}
const rtfree = {rt
- for l in rt.link
+ for l : rt.link
rtfree(l)
;;
std.slfree(rt.link)
@@ -270,7 +270,7 @@ const rangeprogsize = {rt
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 @@ const dump = {re, t, indent
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 @@ const negate = {rng
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 @@ const merge = {rl
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]
diff --git a/lib/regex/interp.myr b/lib/regex/interp.myr
index 6c2c68b..c7e8514 100644
--- a/lib/regex/interp.myr
+++ b/lib/regex/interp.myr
@@ -223,7 +223,7 @@ const run = {re, str, idx, wholestr
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)
diff --git a/lib/regex/redump.myr b/lib/regex/redump.myr
index a69e642..e47b824 100644
--- a/lib/regex/redump.myr
+++ b/lib/regex/redump.myr
@@ -16,7 +16,7 @@ const main = {args
[.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 main = {args
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 @@ const showcoverage = {re
;;
std.put("\t")
- for h in hit
+ for h : hit
if h
std.put("^")
else