MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaB_load

Function luaB_load

third-party/lua-5.5.0/src/lbaselib.c:397–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395
396
397static int luaB_load (lua_State *L) {
398 int status;
399 size_t l;
400 const char *s = lua_tolstring(L, 1, &l);
401 const char *mode = getMode(L, 3);
402 int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */
403 if (s != NULL) { /* loading a string? */
404 const char *chunkname = luaL_optstring(L, 2, s);
405 status = luaL_loadbufferx(L, s, l, chunkname, mode);
406 }
407 else { /* loading from a reader function */
408 const char *chunkname = luaL_optstring(L, 2, "=(load)");
409 luaL_checktype(L, 1, LUA_TFUNCTION);
410 lua_settop(L, RESERVEDSLOT); /* create reserved slot */
411 status = lua_load(L, generic_reader, NULL, chunkname, mode);
412 }
413 return load_aux(L, status, env);
414}
415
416/* }====================================================== */
417

Callers

nothing calls this directly

Calls 7

getModeFunction · 0.85
lua_tolstringFunction · 0.70
luaL_loadbufferxFunction · 0.70
luaL_checktypeFunction · 0.70
lua_settopFunction · 0.70
lua_loadFunction · 0.70
load_auxFunction · 0.70

Tested by

no test coverage detected