MCPcopy Create free account
hub / github.com/defold/defold / add_s

Function add_s

engine/lua/src/lua/lstrlib.c:590–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588
589
590static void add_s (MatchState *ms, luaL_Buffer *b, const char *s,
591 const char *e) {
592 size_t l, i;
593 const char *news = lua_tolstring(ms->L, 3, &l);
594 for (i = 0; i < l; i++) {
595 if (news[i] != L_ESC)
596 luaL_addchar(b, news[i]);
597 else {
598 i++; /* skip ESC */
599 if (!isdigit(uchar(news[i])))
600 luaL_addchar(b, news[i]);
601 else if (news[i] == '0')
602 luaL_addlstring(b, s, e - s);
603 else {
604 push_onecapture(ms, news[i] - '1', s, e);
605 luaL_addvalue(b); /* add capture to accumulated result */
606 }
607 }
608 }
609}
610
611
612static 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