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

Function do_REPL

src/lua/lua_environment.cpp:661–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661static void do_REPL(LuaEnvironment *env, const char *lua)
662{
663 lua_State *L = env->L;
664 int status;
665
666 lua_settop(L, 0);
667 lua_pushstring(L, lua);
668 if ((status = loadline(L)) != -1) { // This is never -1
669 if (status == LUA_OK) {
670 status = env->call(0, LUA_MULTRET);
671 }
672 if (status == LUA_OK)
673 l_print(L);
674 else
675 report(L, status);
676 }
677 lua_settop(L, 0); /* clear stack */
678 return;
679}
680
681static void console_command_REPL(ConsoleServer &cs, u32 client_id, const char *json, void *user_data)
682{

Callers 1

console_command_REPLFunction · 0.85

Calls 6

l_printFunction · 0.85
loadlineFunction · 0.70
reportFunction · 0.70
lua_settopFunction · 0.50
lua_pushstringFunction · 0.50
callMethod · 0.45

Tested by

no test coverage detected