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

Function l_print

src/Chain/libraries/glua/lrepl.cpp:273–283  ·  view source on GitHub ↗

** Prints (calling the Lua 'print' function) any values on the stack */

Source from the content-addressed store, hash-verified

271** Prints (calling the Lua 'print' function) any values on the stack
272*/
273static void l_print(lua_State *L) {
274 int n = lua_gettop(L);
275 if (n > 0) { /* any result to be printed? */
276 luaL_checkstack(L, LUA_MINSTACK, "too many results to print");
277 lua_getglobal(L, "print");
278 lua_insert(L, 1);
279 if (lua_pcall(L, n, 0, 0) != LUA_OK)
280 ll_message(L, progname, lua_pushfstring(L, "error calling 'print' (%s)",
281 lua_tostring(L, -1)));
282 }
283}
284
285
286/*

Callers 1

luaL_doREPLFunction · 0.70

Calls 5

lua_gettopFunction · 0.85
luaL_checkstackFunction · 0.85
lua_getglobalFunction · 0.85
ll_messageFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by

no test coverage detected