MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / singlematch

Function singlematch

src/Chain/libraries/glua/lstrlib.cpp:336–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334
335
336static int singlematch(MatchState *ms, const char *s, const char *p,
337 const char *ep) {
338 if (s >= ms->src_end)
339 return 0;
340 else {
341 int c = uchar(*s);
342 switch (*p) {
343 case '.': return 1; /* matches any char */
344 case L_ESC: return match_class(c, uchar(*(p + 1)));
345 case '[': return matchbracketclass(c, p, ep - 1);
346 default: return (uchar(*p) == c);
347 }
348 }
349}
350
351
352static 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