Browse Source

py/unicode: Add unichar_isalnum().

pull/5478/head
Yonatan Goldschmidt 5 years ago
committed by Damien George
parent
commit
df5c3bd976
  1. 1
      py/misc.h
  2. 4
      py/unicode.c

1
py/misc.h

@ -140,6 +140,7 @@ bool unichar_isprint(unichar c);
bool unichar_isdigit(unichar c);
bool unichar_isxdigit(unichar c);
bool unichar_isident(unichar c);
bool unichar_isalnum(unichar c);
bool unichar_isupper(unichar c);
bool unichar_islower(unichar c);
unichar unichar_tolower(unichar c);

4
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;
}

Loading…
Cancel
Save