ref: 972b52f65248e3fb498069676c4f4707f4eb9457
parent: 9c6298c0d9ea5f9c0e5944995670fd16581e91fb
author: Ori Bernstein <[email protected]>
date: Sat Dec 28 11:26:56 EST 2013
remove 'in' function. It conflicted with a keywrod.
--- a/interp.myr
+++ b/interp.myr
@@ -93,7 +93,7 @@
/* Char matching. Consume exactly one byte from the string. */
| `Ibyte b:
trace(re, thr, "\t%z:\tByte %b (%c)\n", thr.ip, b, b castto(char))
- if !in(re, str)
+ if re.strp >- str.len
die(re, thr, "end of string")
elif b != str[re.strp]
die(re, thr, "not right char")
@@ -103,7 +103,7 @@
;;
| `Irange (start, end):
trace(re, thr, "\t%z:\tRange (%b, %b)\n", thr.ip, start, end)
- if !in(re, str) || start > str[re.strp] || end < str[re.strp]
+ if re.strp >= str.len || start > str[re.strp] || end < str[re.strp]
die(re, thr, "bad range")
else
thr.ip++
@@ -215,10 +215,6 @@
std.slfree(thr.mstart)
std.slfree(thr.mend)
std.free(thr)
-}
-
-const in = {re, str
- -> re.strp < str.len
}
const trace : (re : regex#, thr : rethread#, msg : byte[:], args : ...) = {re, thr, msg, args