| 387 | |
| 388 | |
| 389 | static const char *start_capture (MatchState *ms, const char *s, |
| 390 | const char *p, int what) { |
| 391 | const char *res; |
| 392 | int level = ms->level; |
| 393 | if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); |
| 394 | ms->capture[level].init = s; |
| 395 | ms->capture[level].len = what; |
| 396 | ms->level = level+1; |
| 397 | if ((res=match(ms, s, p)) == NULL) /* match failed? */ |
| 398 | ms->level--; /* undo capture */ |
| 399 | return res; |
| 400 | } |
| 401 | |
| 402 | |
| 403 | static const char *end_capture (MatchState *ms, const char *s, |
no test coverage detected