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

Function luaB_load

third-party/lua-5.2.4/src/lbaselib.c:309–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307
308
309static int luaB_load (lua_State *L) {
310 int status;
311 size_t l;
312 const char *s = lua_tolstring(L, 1, &l);
313 const char *mode = luaL_optstring(L, 3, "bt");
314 int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */
315 if (s != NULL) { /* loading a string? */
316 const char *chunkname = luaL_optstring(L, 2, s);
317 status = luaL_loadbufferx(L, s, l, chunkname, mode);
318 }
319 else { /* loading from a reader function */
320 const char *chunkname = luaL_optstring(L, 2, "=(load)");
321 luaL_checktype(L, 1, LUA_TFUNCTION);
322 lua_settop(L, RESERVEDSLOT); /* create reserved slot */
323 status = lua_load(L, generic_reader, NULL, chunkname, mode);
324 }
325 return load_aux(L, status, env);
326}
327
328/* }====================================================== */
329

Callers

nothing calls this directly

Calls 6

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