| 398 | |
| 399 | |
| 400 | static const char *start_capture(MatchState *ms, const char *s, |
| 401 | const char *p, int what) { |
| 402 | const char *res; |
| 403 | int level = ms->level; |
| 404 | if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); |
| 405 | ms->capture[level].init = s; |
| 406 | ms->capture[level].len = what; |
| 407 | ms->level = level + 1; |
| 408 | if ((res = match(ms, s, p)) == nullptr) /* match failed? */ |
| 409 | ms->level--; /* undo capture */ |
| 410 | return res; |
| 411 | } |
| 412 | |
| 413 | |
| 414 | static const char *end_capture(MatchState *ms, const char *s, |
no test coverage detected