aboutsummaryrefslogtreecommitdiff
path: root/py/unicode.c
diff options
context:
space:
mode:
authorYonatan Goldschmidt <yon.goldschmidt@gmail.com>2019-12-14 14:38:15 +0200
committerDamien George <damien.p.george@gmail.com>2020-01-12 13:03:57 +1100
commitdf5c3bd97654c3719a62bb66627b4b538aa04b0f (patch)
treee0cab563362702ad047976d77be8ddd39a45dbef /py/unicode.c
parentbc5c993adfa1cfb888014213fb70ef0e6916f36a (diff)
py/unicode: Add unichar_isalnum().
Diffstat (limited to 'py/unicode.c')
-rw-r--r--py/unicode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/unicode.c b/py/unicode.c
index d69b6f56f..369240e23 100644
--- a/py/unicode.c
+++ b/py/unicode.c
@@ -140,6 +140,10 @@ bool unichar_isident(unichar c) {
return c < 128 && ((attr[c] & (FL_ALPHA | FL_DIGIT)) != 0 || c == '_');
}
+bool unichar_isalnum(unichar c) {
+ return c < 128 && ((attr[c] & (FL_ALPHA | FL_DIGIT)) != 0);
+}
+
bool unichar_isupper(unichar c) {
return c < 128 && (attr[c] & FL_UPPER) != 0;
}