MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / match_class

Function match_class

Source/Misc/lua/src/lua.c:13903–13919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13901
13902
13903static int match_class (int c, int cl) {
13904int res;
13905switch (tolower(cl)) {
13906case 'a' : res = isalpha(c); break;
13907case 'c' : res = iscntrl(c); break;
13908case 'd' : res = isdigit(c); break;
13909case 'l' : res = islower(c); break;
13910case 'p' : res = ispunct(c); break;
13911case 's' : res = isspace(c); break;
13912case 'u' : res = isupper(c); break;
13913case 'w' : res = isalnum(c); break;
13914case 'x' : res = isxdigit(c); break;
13915case 'z' : res = (c == 0); break;
13916default: return (cl == c);
13917}
13918return (islower(cl) ? res : !res);
13919}
13920
13921
13922static int matchbracketclass (int c, const char *p, const char *ec) {

Callers 2

matchbracketclassFunction · 0.85
singlematchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected