MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / dotty

Function dotty

deps/lua/src/lua.c:216–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215
216static void dotty (lua_State *L) {
217 int status;
218 const char *oldprogname = progname;
219 progname = NULL;
220 while ((status = loadline(L)) != -1) {
221 if (status == 0) status = docall(L, 0, 0);
222 report(L, status);
223 if (status == 0 && lua_gettop(L) > 0) { /* any result to print? */
224 lua_getglobal(L, "print");
225 lua_insert(L, 1);
226 if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0)
227 l_message(progname, lua_pushfstring(L,
228 "error calling " LUA_QL("print") " (%s)",
229 lua_tostring(L, -1)));
230 }
231 }
232 lua_settop(L, 0); /* clear stack */
233 fputs("\n", stdout);
234 fflush(stdout);
235 progname = oldprogname;
236}
237
238
239static int handle_script (lua_State *L, char **argv, int n) {

Callers 1

pmainFunction · 0.85

Calls 9

loadlineFunction · 0.85
docallFunction · 0.85
reportFunction · 0.85
lua_gettopFunction · 0.85
lua_insertFunction · 0.85
lua_pcallFunction · 0.85
l_messageFunction · 0.85
lua_pushfstringFunction · 0.85
lua_settopFunction · 0.85

Tested by

no test coverage detected