diff options
author | Ori Bernstein <ori@eigenstate.org> | 2014-06-21 13:20:34 -0400 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2014-06-21 13:20:34 -0400 |
commit | f19346b49ebab6e9b8838f83f2aa51a98bd082ae (patch) | |
tree | 73382bb907471e9979205da74acd64c9bc6f90d6 /libstd/chartype.myr | |
parent | 49a1983f6bea2adfbc49056ef0fec723c37f08bb (diff) | |
download | mc-f19346b49ebab6e9b8838f83f2aa51a98bd082ae.tar.gz |
Add support for padded strings.
Feeping Creaturinm.
Diffstat (limited to 'libstd/chartype.myr')
-rw-r--r-- | libstd/chartype.myr | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libstd/chartype.myr b/libstd/chartype.myr index c62fcf1..677b90e 100644 --- a/libstd/chartype.myr +++ b/libstd/chartype.myr @@ -9,6 +9,8 @@ use "sys.use" pkg std = /* predicates */ const isalpha : (c : char -> bool) + const isdigit : (c : char -> bool) + const isxdigit : (c : char -> bool) const isnum : (c : char -> bool) const isalnum : (c : char -> bool) const isspace : (c : char -> bool) @@ -1099,6 +1101,14 @@ const isalpha = {c -> false } +const isdigit = {c + -> c >= '0' && c <= '9' +} + +const isxdigit = {c + -> c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' +} + const isnum = {c var l |