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

Function max_expand

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

Source from the content-addressed store, hash-verified

355
356
357static const char *max_expand (MatchState *ms, const char *s,
358 const char *p, const char *ep) {
359 ptrdiff_t i = 0; /* counts maximum expand for item */
360 while (singlematch(ms, s + i, p, ep))
361 i++;
362 /* keeps trying to match with the maximum repetitions */
363 while (i>=0) {
364 const char *res = match(ms, (s+i), ep+1);
365 if (res) return res;
366 i--; /* else didn't match; reduce 1 repetition to try again */
367 }
368 return NULL;
369}
370
371
372static 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