| 534 | |
| 535 | |
| 536 | static const char *start_capture (MatchState *ms, const char *s, |
| 537 | const char *p, int what) { |
| 538 | const char *res; |
| 539 | int level = ms->level; |
| 540 | if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); |
| 541 | ms->capture[level].init = s; |
| 542 | ms->capture[level].len = what; |
| 543 | ms->level = level+1; |
| 544 | if ((res=match(ms, s, p)) == NULL) /* match failed? */ |
| 545 | ms->level--; /* undo capture */ |
| 546 | return res; |
| 547 | } |
| 548 | |
| 549 | |
| 550 | static const char *end_capture (MatchState *ms, const char *s, |
no test coverage detected