MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / matchbracketclass

Function matchbracketclass

third-party/lua-5.4.6/src/lstrlib.c:447–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445
446
447static int matchbracketclass (int c, const char *p, const char *ec) {
448 int sig = 1;
449 if (*(p+1) == '^') {
450 sig = 0;
451 p++; /* skip the '^' */
452 }
453 while (++p < ec) {
454 if (*p == L_ESC) {
455 p++;
456 if (match_class(c, uchar(*p)))
457 return sig;
458 }
459 else if ((*(p+1) == '-') && (p+2 < ec)) {
460 p+=2;
461 if (uchar(*(p-2)) <= c && c <= uchar(*p))
462 return sig;
463 }
464 else if (uchar(*p) == c) return sig;
465 }
466 return !sig;
467}
468
469
470static int singlematch (MatchState *ms, const char *s, const char *p,

Callers 2

singlematchFunction · 0.70
matchFunction · 0.70

Calls 1

match_classFunction · 0.70

Tested by

no test coverage detected