MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / luaopen_base

Function luaopen_base

src/lbaselib.cpp:914–928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912
913
914LUAMOD_API int luaopen_base (lua_State *L) {
915 /* open lib into global table */
916 lua_pushglobaltable(L);
917 luaL_setfuncs(L, base_funcs, 0);
918 /* set global _G */
919 lua_pushvalue(L, -1);
920 lua_setfield(L, -2, LUA_GNAME);
921 /* set global _VERSION */
922 lua_pushliteral(L, LUA_VERSION);
923 lua_setfield(L, -2, "_VERSION");
924 /* set global _PVERSION */
925 lua_pushliteral(L, PLUTO_VERSION);
926 lua_setfield(L, -2, "_PVERSION");
927 return 1;
928}
929

Callers

nothing calls this directly

Calls 3

luaL_setfuncsFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85

Tested by

no test coverage detected