MCPcopy Create free account
hub / github.com/DFHack/dfhack / gmatch_aux

Function gmatch_aux

depends/lua/src/lstrlib.c:673–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671
672
673static int gmatch_aux (lua_State *L) {
674 GMatchState *gm = (GMatchState *)lua_touserdata(L, lua_upvalueindex(3));
675 const char *src;
676 gm->ms.L = L;
677 for (src = gm->src; src <= gm->ms.src_end; src++) {
678 const char *e;
679 reprepstate(&gm->ms);
680 if ((e = match(&gm->ms, src, gm->p)) != NULL && e != gm->lastmatch) {
681 gm->src = gm->lastmatch = e;
682 return push_captures(&gm->ms, src, e);
683 }
684 }
685 return 0; /* not found */
686}
687
688
689static int gmatch (lua_State *L) {

Callers

nothing calls this directly

Calls 4

lua_touserdataFunction · 0.85
reprepstateFunction · 0.85
push_capturesFunction · 0.85
matchFunction · 0.70

Tested by

no test coverage detected