** utfchar(n1, n2, ...) -> char(n1)..char(n2)... */
| 154 | ** utfchar(n1, n2, ...) -> char(n1)..char(n2)... |
| 155 | */ |
| 156 | static int utfchar (lua_State *L) { |
| 157 | int n = lua_gettop(L); /* number of arguments */ |
| 158 | if (n == 1) /* optimize common case of single char */ |
| 159 | pushutfchar(L, 1); |
| 160 | else { |
| 161 | int i; |
| 162 | luaL_Buffer b; |
| 163 | luaL_buffinit(L, &b); |
| 164 | for (i = 1; i <= n; i++) { |
| 165 | pushutfchar(L, i); |
| 166 | luaL_addvalue(&b); |
| 167 | } |
| 168 | luaL_pushresult(&b); |
| 169 | } |
| 170 | return 1; |
| 171 | } |
| 172 | |
| 173 | |
| 174 | /* |
nothing calls this directly
no test coverage detected