MCPcopy Create free account
hub / github.com/F-Stack/f-stack / singlematch

Function singlematch

freebsd/contrib/openzfs/module/lua/lstrlib.c:320–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319
320static int singlematch (MatchState *ms, const char *s, const char *p,
321 const char *ep) {
322 if (s >= ms->src_end)
323 return 0;
324 else {
325 int c = uchar(*s);
326 switch (*p) {
327 case '.': return 1; /* matches any char */
328 case L_ESC: return match_class(c, uchar(*(p+1)));
329 case '[': return matchbracketclass(c, p, ep-1);
330 default: return (uchar(*p) == c);
331 }
332 }
333}
334
335
336static 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