MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaL_doREPL

Function luaL_doREPL

src/Chain/libraries/glua/lrepl.cpp:431–448  ·  view source on GitHub ↗

** Do the REPL: repeatedly read (load) a line, evaluate (call) it, and ** print any results. */

Source from the content-addressed store, hash-verified

429** print any results.
430*/
431void luaL_doREPL(lua_State *L)
432{
433 int status;
434 const char *oldprogname = progname;
435 progname = nullptr; /* no 'progname' on errors in interactive mode */
436 int *state = thinkyoung::lua::lib::get_repl_state(L);
437 while ((status = loadline(L)) != -1 && *state > 0) {
438 if (status == LUA_OK)
439 status = docall(L, 0, LUA_MULTRET);
440 if (status == LUA_OK) l_print(L);
441 else report(L, status);
442 if (*state <= 0)
443 break;
444 }
445 lua_settop(L, 0); /* clear stack */
446 luaL_writeline(L);
447 progname = oldprogname;
448}

Callers 1

start_replFunction · 0.85

Calls 6

get_repl_stateFunction · 0.85
lua_settopFunction · 0.85
loadlineFunction · 0.70
docallFunction · 0.70
l_printFunction · 0.70
reportFunction · 0.70

Tested by

no test coverage detected