| 14004 | |
| 14005 | |
| 14006 | static const char *start_capture (MatchState *ms, const char *s, |
| 14007 | const char *p, int what) { |
| 14008 | const char *res; |
| 14009 | int level = ms->level; |
| 14010 | if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); |
| 14011 | ms->capture[level].init = s; |
| 14012 | ms->capture[level].len = what; |
| 14013 | ms->level = level+1; |
| 14014 | if ((res=match(ms, s, p)) == NULL) /* match failed? */ |
| 14015 | ms->level--; /* undo capture */ |
| 14016 | return res; |
| 14017 | } |
| 14018 | |
| 14019 | |
| 14020 | static const char *end_capture (MatchState *ms, const char *s, |
no test coverage detected