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