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