MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / l_print

Function l_print

3rd/lua-5.4.3/src/lua.c:560–570  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

558** Prints (calling the Lua 'print' function) any values on the stack
559*/
560static void l_print (lua_State *L) {
561 int n = lua_gettop(L);
562 if (n > 0) { /* any result to be printed? */
563 luaL_checkstack(L, LUA_MINSTACK, "too many results to print");
564 lua_getglobal(L, "print");
565 lua_insert(L, 1);
566 if (lua_pcall(L, n, 0, 0) != LUA_OK)
567 l_message(progname, lua_pushfstring(L, "error calling 'print' (%s)",
568 lua_tostring(L, -1)));
569 }
570}
571
572
573/*

Callers 1

doREPLFunction · 0.85

Calls 5

lua_gettopFunction · 0.85
luaL_checkstackFunction · 0.85
lua_getglobalFunction · 0.85
l_messageFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by

no test coverage detected