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

Function doREPL

src/Chain/libraries/glua/lua.cpp:403–416  ·  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

401** print any results.
402*/
403static void doREPL(lua_State *L) {
404 int status;
405 const char *oldprogname = progname;
406 progname = nullptr; /* no 'progname' on errors in interactive mode */
407 while ((status = loadline(L)) != -1) {
408 if (status == LUA_OK)
409 status = docall(L, 0, LUA_MULTRET);
410 if (status == LUA_OK) l_print(L);
411 else report(L, status);
412 }
413 lua_settop(L, 0); /* clear stack */
414 lua_writeline();
415 progname = oldprogname;
416}
417
418
419/*

Callers 1

pmainFunction · 0.70

Calls 5

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

Tested by

no test coverage detected