summaryrefslogtreecommitdiff
path: root/lib/regex
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-11-28 12:00:09 -0800
committerOri Bernstein <ori@markovcorp.com>2017-11-28 12:03:31 -0800
commit1af62a6b4e9e10444098c57f64b1ad1b9cb03b95 (patch)
treefb70492f26f42a7903dd2013f63b6506e7b239c0 /lib/regex
parent3df8885d396e1bc36fe25a329bc4e63400126ecf (diff)
downloadmc-1af62a6b4e9e10444098c57f64b1ad1b9cb03b95.tar.gz
Allow local variables to shadow namespaces.
It means you can't access the namespace in that scope, but it also means that we don't get the weird behavior that the undotted name refers to the variable, but the dotted name refers to the namespace. Fixes #158
Diffstat (limited to 'lib/regex')
-rw-r--r--lib/regex/test/testmatch.myr12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/regex/test/testmatch.myr b/lib/regex/test/testmatch.myr
index 78f8402..6957a9b 100644
--- a/lib/regex/test/testmatch.myr
+++ b/lib/regex/test/testmatch.myr
@@ -65,10 +65,10 @@ const dbgmatch = {pat, text, expected
run(regex.dbgcompile(pat, true), pat, text, expected, false)
}
-const subst = {regex, pat, text, sub, expected, all
+const subst = {restr, pat, text, sub, expected, all
var re, r
- re = std.try(regex)
+ re = std.try(restr)
if all
r = `std.Some regex.suball(re, text, sub)
else
@@ -94,11 +94,11 @@ const subst = {regex, pat, text, sub, expected, all
;;
}
-const runidx = {regex, pat, text, expected : std.option((std.size, std.size)[:]), search
+const runidx = {restr, pat, text, expected : std.option((std.size, std.size)[:]), search
var re, r
var lo, elo, hi, ehi
- re = std.try(regex)
+ re = std.try(restr)
if search
r = regex.isearch(re, text)
else
@@ -139,10 +139,10 @@ const runidx = {regex, pat, text, expected : std.option((std.size, std.size)[:])
;;
regex.free(re)
}
-const run = {regex, pat, text, expected, search
+const run = {restr, pat, text, expected, search
var i, re, r
- re = std.try(regex)
+ re = std.try(restr)
if search
r = regex.search(re, text)
else