summaryrefslogtreecommitdiff
path: root/lib/regex/interp.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-12 09:01:39 -0700
committerOri Bernstein <ori@eigenstate.org>2015-09-15 23:01:09 -0700
commit610852e18629b8a9a4c4f4ed6e6fc7a336152511 (patch)
treeb69e2c8d29091b688115a499a50521d6d81cad1a /lib/regex/interp.myr
parentae9a74441cba3160943ad18bf500781143bff096 (diff)
downloadmc-610852e18629b8a9a4c4f4ed6e6fc7a336152511.tar.gz
Move to use 'for var i = ...' construct.
Diffstat (limited to 'lib/regex/interp.myr')
-rw-r--r--lib/regex/interp.myr7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/regex/interp.myr b/lib/regex/interp.myr
index fc179c0..b6710a7 100644
--- a/lib/regex/interp.myr
+++ b/lib/regex/interp.myr
@@ -46,10 +46,9 @@ const cleanup = {re
const getmatches = {re, thr
var ret
- var i
ret = std.slalloc(re.nmatch)
- for i = 0; i < re.nmatch; i++
+ for var i = 0; i < re.nmatch; i++
if thr.mstart[i] != -1 && thr.mend[i] != -1
ret[i] = re.str[thr.mstart[i]:thr.mend[i]]
else
@@ -62,7 +61,7 @@ const getmatches = {re, thr
/* returns a matching thread, or Zthr if no threads matched */
const run = {re
- var i, ip
+ var ip
var consumed
var thr
var states
@@ -71,7 +70,7 @@ const run = {re
re.runq = mkthread(re, 0)
re.runq.mstart = std.slalloc(re.nmatch)
re.runq.mend = std.slalloc(re.nmatch)
- for i = 0; i < re.nmatch; i++
+ for var i = 0; i < re.nmatch; i++
re.runq.mstart[i] = -1
re.runq.mend[i] = -1
;;