MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / start_capture

Function start_capture

deps/lua/src/lstrlib.c:329–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327
328
329static const char *start_capture (MatchState *ms, const char *s,
330 const char *p, int what) {
331 const char *res;
332 int level = ms->level;
333 if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures");
334 ms->capture[level].init = s;
335 ms->capture[level].len = what;
336 ms->level = level+1;
337 if ((res=match(ms, s, p)) == NULL) /* match failed? */
338 ms->level--; /* undo capture */
339 return res;
340}
341
342
343static const char *end_capture (MatchState *ms, const char *s,

Callers 1

matchFunction · 0.85

Calls 2

luaL_errorFunction · 0.85
matchFunction · 0.85

Tested by

no test coverage detected