| 372 | |
| 373 | |
| 374 | static const char *start_capture (MatchState *ms, const char *s, |
| 375 | const char *p, int what) { |
| 376 | const char *res; |
| 377 | int level = ms->level; |
| 378 | if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); |
| 379 | ms->capture[level].init = s; |
| 380 | ms->capture[level].len = what; |
| 381 | ms->level = level+1; |
| 382 | if ((res=match(ms, s, p)) == NULL) /* match failed? */ |
| 383 | ms->level--; /* undo capture */ |
| 384 | return res; |
| 385 | } |
| 386 | |
| 387 | |
| 388 | static const char *end_capture (MatchState *ms, const char *s, |
no test coverage detected