MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / dotty

Function dotty

lua/lua.c:214–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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