| 327 | |
| 328 | |
| 329 | static 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 | |
| 343 | static const char *end_capture (MatchState *ms, const char *s, |
no test coverage detected