summaryrefslogtreecommitdiff
path: root/lib/regex
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2018-01-27 12:22:19 -0800
committerOri Bernstein <ori@markovcorp.com>2018-01-27 12:23:36 -0800
commit4c94aae21c2c2aec19d4fd5871cfe92bc09303a7 (patch)
treeb7c773a2274cb3b3ee46d9e90d54a3b6c4ddce37 /lib/regex
parentdbe9ae0f9dbed30d40952261384b4673766d83ca (diff)
downloadmc-4c94aae21c2c2aec19d4fd5871cfe92bc09303a7.tar.gz
Remove std.sleq
We have std.eq. We still export a generic sleq for compatibility, but we don't need it or want it.
Diffstat (limited to 'lib/regex')
-rw-r--r--lib/regex/compile.myr14
-rw-r--r--lib/regex/test/testmatch.myr6
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/regex/compile.myr b/lib/regex/compile.myr
index 24cd9cc..4c52d98 100644
--- a/lib/regex/compile.myr
+++ b/lib/regex/compile.myr
@@ -729,20 +729,20 @@ const unicodeclass = {re, neg
;;
s = s[:n]
/* letters */
- if std.sleq(s, "L") || std.sleq(s, "Letter")
+ if std.eq(s, "L") || std.eq(s, "Letter")
tab = _ranges.tabalpha[:]
- elif std.sleq(s, "Lu") || std.sleq(s, "Uppercase_Letter")
+ elif std.eq(s, "Lu") || std.eq(s, "Uppercase_Letter")
tab = _ranges.tabupper[:]
- elif std.sleq(s, "Ll") || std.sleq(s, "Lowercase_Letter")
+ elif std.eq(s, "Ll") || std.eq(s, "Lowercase_Letter")
tab = _ranges.tablower[:]
- elif std.sleq(s, "Lt") || std.sleq(s, "Titlecase_Letter")
+ elif std.eq(s, "Lt") || std.eq(s, "Titlecase_Letter")
tab = _ranges.tablower[:]
/* numbers (incomplete) */
- elif std.sleq(s, "N") || std.sleq(s, "Number")
+ elif std.eq(s, "N") || std.eq(s, "Number")
tab = _ranges.tabdigit[:]
- elif std.sleq(s, "Z") || std.sleq(s, "Separator")
+ elif std.eq(s, "Z") || std.eq(s, "Separator")
tab = _ranges.tabspace[:]
- elif std.sleq(s, "Zs") || std.sleq(s, "Space_Separator")
+ elif std.eq(s, "Zs") || std.eq(s, "Space_Separator")
tab = _ranges.tabblank[:]
else
-> `Err (`Badrange s)
diff --git a/lib/regex/test/testmatch.myr b/lib/regex/test/testmatch.myr
index 6957a9b..18cb78a 100644
--- a/lib/regex/test/testmatch.myr
+++ b/lib/regex/test/testmatch.myr
@@ -79,7 +79,7 @@ const subst = {restr, pat, text, sub, expected, all
std.put("res: {}\n", res)
match expected
| `std.Some e:
- if !std.sleq(res, e)
+ if !std.eq(res, e)
std.fatal("bad subst: expected {}, got {}\n", e, res)
;;
| `std.None:
@@ -157,7 +157,7 @@ const run = {restr, pat, text, expected, search
std.put("\t{}: {}\n", i, res[i])
;;
| `std.Some exp:
- if !search && !std.sleq(res[0], text)
+ if !search && !std.eq(res[0], text)
std.put("whole match does not match text!\n")
std.fatal("failed matching {} over {}\n", pat, text)
;;
@@ -167,7 +167,7 @@ const run = {restr, pat, text, expected, search
std.fatal("failed matching {} over {}\n", pat, text)
;;
for i = 0; i < exp.len; i++
- if !std.sleq(res[i], exp[i])
+ if !std.eq(res[i], exp[i])
std.put("mismatch on {}: expected {}, got {}\n", i, exp[i], res[i])
std.fatal("failed matching {} over {}\n", pat, text)
;;