| 14265 | |
| 14266 | |
| 14267 | static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, |
| 14268 | const char *e) { |
| 14269 | size_t l, i; |
| 14270 | const char *news = lua_tolstring(ms->L, 3, &l); |
| 14271 | for (i = 0; i < l; i++) { |
| 14272 | if (news[i] != L_ESC) |
| 14273 | luaL_addchar(b, news[i]); |
| 14274 | else { |
| 14275 | i++; /* skip ESC */ |
| 14276 | if (!isdigit(uchar(news[i]))) |
| 14277 | luaL_addchar(b, news[i]); |
| 14278 | else if (news[i] == '0') |
| 14279 | luaL_addlstring(b, s, e - s); |
| 14280 | else { |
| 14281 | push_onecapture(ms, news[i] - '1', s, e); |
| 14282 | luaL_addvalue(b); /* add capture to accumulated result */ |
| 14283 | } |
| 14284 | } |
| 14285 | } |
| 14286 | } |
| 14287 | |
| 14288 | |
| 14289 | static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, |
no test coverage detected