MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / singlematch

Function singlematch

lib/lua/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.85
min_expandFunction · 0.85
matchFunction · 0.85

Calls 2

match_classFunction · 0.85
matchbracketclassFunction · 0.85

Tested by

no test coverage detected