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

Function doREPL

third-party/lua-5.4.6/src/lua.c:602–616  ·  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

600** print any results.
601*/
602static void doREPL (lua_State *L) {
603 int status;
604 const char *oldprogname = progname;
605 progname = NULL; /* no 'progname' on errors in interactive mode */
606 lua_initreadline(L);
607 while ((status = loadline(L)) != -1) {
608 if (status == LUA_OK)
609 status = docall(L, 0, LUA_MULTRET);
610 if (status == LUA_OK) l_print(L);
611 else report(L, status);
612 }
613 lua_settop(L, 0); /* clear stack */
614 lua_writeline();
615 progname = oldprogname;
616}
617
618/* }================================================================== */
619

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