MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / match_class

Function match_class

3rd/lua-5.4.3/src/lstrlib.c:427–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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