MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / singlematch

Function singlematch

extlibs/lua/src/lstrlib.c:467–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

max_expandFunction · 0.85
min_expandFunction · 0.85
matchFunction · 0.85

Calls 2

match_classFunction · 0.85
matchbracketclassFunction · 0.85

Tested by

no test coverage detected