Skip to content

Commit

Permalink
py/unicode: Add unichar_isalnum().
Browse files Browse the repository at this point in the history
  • Loading branch information
Jongy authored and dpgeorge committed Jan 12, 2020
1 parent bc5c993 commit df5c3bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions py/misc.h
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions py/unicode.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit df5c3bd

Please sign in to comment.