** utfchar(n1, n2, ...) -> char(n1)..char(n2)... */
| 159 | ** utfchar(n1, n2, ...) -> char(n1)..char(n2)... |
| 160 | */ |
| 161 | static 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 | /* |
nothing calls this directly
no test coverage detected