| 163 | } |
| 164 | |
| 165 | lua_State * |
| 166 | ts_lua_new_state() |
| 167 | { |
| 168 | lua_State *L; |
| 169 | |
| 170 | L = luaL_newstate(); |
| 171 | |
| 172 | if (L == nullptr) { |
| 173 | return nullptr; |
| 174 | } |
| 175 | |
| 176 | luaL_openlibs(L); |
| 177 | |
| 178 | ts_lua_init_registry(L); |
| 179 | |
| 180 | ts_lua_init_globals(L); |
| 181 | |
| 182 | return L; |
| 183 | } |
| 184 | |
| 185 | ts_lua_ctx_stats * |
| 186 | ts_lua_create_ctx_stats() |
no test coverage detected