MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / gmatch_aux

Function gmatch_aux

src/Chain/libraries/glua/lstrlib.cpp:753–769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751
752
753static int gmatch_aux(lua_State *L) {
754 GMatchState *gm = (GMatchState *)lua_touserdata(L, lua_upvalueindex(3));
755 const char *src;
756 gm->ms.L = L;
757 for (src = gm->src; src <= gm->ms.src_end; src++) {
758 const char *e;
759 reprepstate(&gm->ms);
760 if ((e = match(&gm->ms, src, gm->p)) != nullptr) {
761 if (e == src) /* empty match? */
762 gm->src = src + 1; /* go at least one position */
763 else
764 gm->src = e;
765 return push_captures(&gm->ms, src, e);
766 }
767 }
768 return 0; /* not found */
769}
770
771
772static 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