MCPcopy Create free account
hub / github.com/crownengine/crown / execute_string

Method execute_string

src/lua/lua_environment.cpp:393–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393LuaStack LuaEnvironment::execute_string(const char *s)
394{
395 LuaStack stack(L);
396 int status;
397
398 status = luaL_loadstring(L, s);
399 if (status == LUA_OK)
400 status = this->call(0, 0);
401 if (status != LUA_OK) {
402 report(L, status);
403 device()->pause();
404 }
405
406 CE_ASSERT(lua_gettop(L) == 0, "Stack not clean");
407 return stack;
408}
409
410void LuaEnvironment::add_module_function(const char *module, const char *name, const lua_CFunction func)
411{

Callers 2

main_loopMethod · 0.80
console_command_scriptFunction · 0.80

Calls 6

callMethod · 0.95
luaL_loadstringFunction · 0.85
deviceFunction · 0.85
reportFunction · 0.70
lua_gettopFunction · 0.50
pauseMethod · 0.45

Tested by

no test coverage detected