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

Function singlematch

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

Source from the content-addressed store, hash-verified

470
471
472static int singlematch (MatchState *ms, const char *s, const char *p,
473 const char *ep) {
474 if (s >= ms->src_end)
475 return 0;
476 else {
477 int c = cast_uchar(*s);
478 switch (*p) {
479 case '.': return 1; /* matches any char */
480 case L_ESC: return match_class(c, cast_uchar(*(p+1)));
481 case '[': return matchbracketclass(c, p, ep-1);
482 default: return (cast_uchar(*p) == c);
483 }
484 }
485}
486
487
488static const char *matchbalance (MatchState *ms, const char *s,

Callers 3

max_expandFunction · 0.70
min_expandFunction · 0.70
matchFunction · 0.70

Calls 2

match_classFunction · 0.70
matchbracketclassFunction · 0.70

Tested by

no test coverage detected