| 751 | |
| 752 | |
| 753 | static 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 | |
| 772 | static int gmatch(lua_State *L) { |
nothing calls this directly
no test coverage detected