MCPcopy Create free account
hub / github.com/Cubitect/cubiomes-viewer / doREPL

Function doREPL

lua/src/lua.c:584–598  ·  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

582** print any results.
583*/
584static void doREPL (lua_State *L) {
585 int status;
586 const char *oldprogname = progname;
587 progname = NULL; /* no 'progname' on errors in interactive mode */
588 lua_initreadline(L);
589 while ((status = loadline(L)) != -1) {
590 if (status == LUA_OK)
591 status = docall(L, 0, LUA_MULTRET);
592 if (status == LUA_OK) l_print(L);
593 else report(L, status);
594 }
595 lua_settop(L, 0); /* clear stack */
596 lua_writeline();
597 progname = oldprogname;
598}
599
600/* }================================================================== */
601

Callers 1

pmainFunction · 0.85

Calls 5

loadlineFunction · 0.85
docallFunction · 0.85
l_printFunction · 0.85
reportFunction · 0.85
lua_settopFunction · 0.85

Tested by

no test coverage detected