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

Function matchbracketclass

third-party/lua-5.5.0/src/lstrlib.c:449–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447
448
449static int matchbracketclass (int c, const char *p, const char *ec) {
450 int sig = 1;
451 if (*(p+1) == '^') {
452 sig = 0;
453 p++; /* skip the '^' */
454 }
455 while (++p < ec) {
456 if (*p == L_ESC) {
457 p++;
458 if (match_class(c, cast_uchar(*p)))
459 return sig;
460 }
461 else if ((*(p+1) == '-') && (p+2 < ec)) {
462 p+=2;
463 if (cast_uchar(*(p-2)) <= c && c <= cast_uchar(*p))
464 return sig;
465 }
466 else if (cast_uchar(*p) == c) return sig;
467 }
468 return !sig;
469}
470
471
472static 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