MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / gmatch_aux

Function gmatch_aux

extlibs/lua/src/lstrlib.c:835–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

833
834
835static int gmatch_aux (lua_State *L) {
836 GMatchState *gm = (GMatchState *)lua_touserdata(L, lua_upvalueindex(3));
837 const char *src;
838 gm->ms.L = L;
839 for (src = gm->src; src <= gm->ms.src_end; src++) {
840 const char *e;
841 reprepstate(&gm->ms);
842 if ((e = match(&gm->ms, src, gm->p)) != NULL && e != gm->lastmatch) {
843 gm->src = gm->lastmatch = e;
844 return push_captures(&gm->ms, src, e);
845 }
846 }
847 return 0; /* not found */
848}
849
850
851static 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