** utfchar(n1, n2, ...) -> char(n1)..char(n2)... */
| 136 | ** utfchar(n1, n2, ...) -> char(n1)..char(n2)... |
| 137 | */ |
| 138 | static int utfchar (lua_State *L) { |
| 139 | int n = lua_gettop(L); /* number of arguments */ |
| 140 | if (n == 1) /* optimize common case of single char */ |
| 141 | pushutfchar(L, 1); |
| 142 | else { |
| 143 | int i; |
| 144 | luaL_Buffer b; |
| 145 | luaL_buffinit(L, &b); |
| 146 | for (i = 1; i <= n; i++) { |
| 147 | pushutfchar(L, i); |
| 148 | luaL_addvalue(&b); |
| 149 | } |
| 150 | luaL_pushresult(&b); |
| 151 | } |
| 152 | return 1; |
| 153 | } |
| 154 | |
| 155 | |
| 156 | /* |
nothing calls this directly
no test coverage detected