MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / match_class

Function match_class

extlibs/lua/src/lstrlib.c:424–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422
423
424static int match_class (int c, int cl) {
425 int res;
426 switch (tolower(cl)) {
427 case 'a' : res = isalpha(c); break;
428 case 'c' : res = iscntrl(c); break;
429 case 'd' : res = isdigit(c); break;
430 case 'g' : res = isgraph(c); break;
431 case 'l' : res = islower(c); break;
432 case 'p' : res = ispunct(c); break;
433 case 's' : res = isspace(c); break;
434 case 'u' : res = isupper(c); break;
435 case 'w' : res = isalnum(c); break;
436 case 'x' : res = isxdigit(c); break;
437 case 'z' : res = (c == 0); break; /* deprecated option */
438 default: return (cl == c);
439 }
440 return (islower(cl) ? res : !res);
441}
442
443
444static 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