summaryrefslogtreecommitdiff
path: root/lib/std/chartype.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-06-19 20:02:42 -0700
committerOri Bernstein <ori@eigenstate.org>2016-06-19 20:02:42 -0700
commit0f945628a2af04425ddfd3117b890c6168eeb381 (patch)
treed1ae1001b4459a1f22c0d5d6b3906024022e8275 /lib/std/chartype.myr
parent595f94567824d5c4d1e4ef75ed825eccc6b1783c (diff)
downloadmc-0f945628a2af04425ddfd3117b890c6168eeb381.tar.gz
Add isascii prediate.
Diffstat (limited to 'lib/std/chartype.myr')
-rw-r--r--lib/std/chartype.myr5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/std/chartype.myr b/lib/std/chartype.myr
index 60e6dd6..dd31e20 100644
--- a/lib/std/chartype.myr
+++ b/lib/std/chartype.myr
@@ -18,6 +18,7 @@ pkg std =
const islower : (c : char -> bool)
const isupper : (c : char -> bool)
const istitle : (c : char -> bool)
+ const isascii : (c : char -> bool)
/* transforms */
const tolower : (c : char -> char)
@@ -1183,6 +1184,10 @@ const istitle = {c
-> isupper(c) && islower(c)
}
+const isascii = {c
+ -> c < 0x80
+}
+
const tolower = {c
var l