MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / doREPL

Function doREPL

third-party/lua-5.5.0/src/lua.c:677–691  ·  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

675** print any results.
676*/
677static void doREPL (lua_State *L) {
678 int status;
679 const char *oldprogname = progname;
680 progname = NULL; /* no 'progname' on errors in interactive mode */
681 lua_initreadline(L);
682 while ((status = loadline(L)) != -1) {
683 if (status == LUA_OK)
684 status = docall(L, 0, LUA_MULTRET);
685 if (status == LUA_OK) l_print(L);
686 else report(L, status);
687 }
688 lua_settop(L, 0); /* clear stack */
689 lua_writeline();
690 progname = oldprogname;
691}
692
693/* }================================================================== */
694

Callers 1

pmainFunction · 0.70

Calls 6

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

Tested by

no test coverage detected