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

Function singlematch

third-party/lua-5.2.4/src/lstrlib.c:309–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307
308
309static int singlematch (MatchState *ms, const char *s, const char *p,
310 const char *ep) {
311 if (s >= ms->src_end)
312 return 0;
313 else {
314 int c = uchar(*s);
315 switch (*p) {
316 case '.': return 1; /* matches any char */
317 case L_ESC: return match_class(c, uchar(*(p+1)));
318 case '[': return matchbracketclass(c, p, ep-1);
319 default: return (uchar(*p) == c);
320 }
321 }
322}
323
324
325static 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