MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / utfchar

Function utfchar

extlibs/lua/src/lutf8lib.c:161–176  ·  view source on GitHub ↗

** utfchar(n1, n2, ...) -> char(n1)..char(n2)... */

Source from the content-addressed store, hash-verified

159** utfchar(n1, n2, ...) -> char(n1)..char(n2)...
160*/
161static int utfchar (lua_State *L) {
162 int n = lua_gettop(L); /* number of arguments */
163 if (n == 1) /* optimize common case of single char */
164 pushutfchar(L, 1);
165 else {
166 int i;
167 luaL_Buffer b;
168 luaL_buffinit(L, &b);
169 for (i = 1; i <= n; i++) {
170 pushutfchar(L, i);
171 luaL_addvalue(&b);
172 }
173 luaL_pushresult(&b);
174 }
175 return 1;
176}
177
178
179/*

Callers

nothing calls this directly

Calls 5

lua_gettopFunction · 0.85
pushutfcharFunction · 0.85
luaL_buffinitFunction · 0.70
luaL_addvalueFunction · 0.70
luaL_pushresultFunction · 0.70

Tested by

no test coverage detected