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

Function max_expand

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

Source from the content-addressed store, hash-verified

344
345
346static const char *max_expand (MatchState *ms, const char *s,
347 const char *p, const char *ep) {
348 ptrdiff_t i = 0; /* counts maximum expand for item */
349 while (singlematch(ms, s + i, p, ep))
350 i++;
351 /* keeps trying to match with the maximum repetitions */
352 while (i>=0) {
353 const char *res = match(ms, (s+i), ep+1);
354 if (res) return res;
355 i--; /* else didn't match; reduce 1 repetition to try again */
356 }
357 return NULL;
358}
359
360
361static const char *min_expand (MatchState *ms, const char *s,

Callers 1

matchFunction · 0.70

Calls 2

singlematchFunction · 0.70
matchFunction · 0.70

Tested by

no test coverage detected