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

Function singlematch

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

Source from the content-addressed store, hash-verified

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