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

Function dotty

third-party/lua-5.2.4/src/lua.c:303–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301
302
303static void dotty (lua_State *L) {
304 int status;
305 const char *oldprogname = progname;
306 progname = NULL;
307 while ((status = loadline(L)) != -1) {
308 if (status == LUA_OK) status = docall(L, 0, LUA_MULTRET);
309 report(L, status);
310 if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */
311 luaL_checkstack(L, LUA_MINSTACK, "too many results to print");
312 lua_getglobal(L, "print");
313 lua_insert(L, 1);
314 if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK)
315 l_message(progname, lua_pushfstring(L,
316 "error calling " LUA_QL("print") " (%s)",
317 lua_tostring(L, -1)));
318 }
319 }
320 lua_settop(L, 0); /* clear stack */
321 luai_writeline();
322 progname = oldprogname;
323}
324
325
326static int handle_script (lua_State *L, char **argv, int n) {

Callers 1

pmainFunction · 0.70

Calls 11

loadlineFunction · 0.70
docallFunction · 0.70
reportFunction · 0.70
lua_gettopFunction · 0.70
luaL_checkstackFunction · 0.70
lua_getglobalFunction · 0.70
lua_insertFunction · 0.70
l_messageFunction · 0.70
lua_pushfstringFunction · 0.70
lua_settopFunction · 0.70
lua_pcallFunction · 0.50

Tested by

no test coverage detected