MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / add_s

Function add_s

Source/Misc/lua/src/lua.c:14267–14286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

add_valueFunction · 0.85

Calls 4

lua_tolstringFunction · 0.85
luaL_addlstringFunction · 0.85
push_onecaptureFunction · 0.85
luaL_addvalueFunction · 0.85

Tested by

no test coverage detected