ref: 6f1d771f9e6fee4b3f9d84da05bf1c96f964df70
parent: 530ed98bad8ebbc5448fdd897e7c6aa801f36d98
author: Ori Bernstein <[email protected]>
date: Sat Dec 28 11:32:11 EST 2013
Rename 'in' function to avoid keyword conflict.
--- a/interp.myr
+++ b/interp.myr
@@ -95,7 +95,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 !within(re, str)
die(re, thr, "end of string")
elif b != str[re.strp]
die(re, thr, "not right char")
@@ -105,7 +105,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 !within(re, str) || start > str[re.strp] || end < str[re.strp]
die(re, thr, "bad range")
else
thr.ip++
@@ -222,7 +222,7 @@
std.free(thr)
}
-const in = {re, str
+const within = {re, str
-> re.strp < str.len
}