MCPcopy Create free account
hub / github.com/Segs/Segs / script

Function script

3rd_party/lua_sol2/include/sol.hpp:11814–11820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11812 }
11813
11814 inline void script(lua_State* L, const string_view& code, const std::string& chunkname = detail::default_chunk_name(), load_mode mode = load_mode::any) {
11815 detail::typical_chunk_name_t basechunkname = {};
11816 const char* chunknametarget = detail::make_chunk_name(code, chunkname, basechunkname);
11817 if (luaL_loadbufferx(L, code.data(), code.size(), chunknametarget, to_string(mode).c_str()) || lua_pcall(L, 0, LUA_MULTRET, 0)) {
11818 lua_error(L);
11819 }
11820 }
11821
11822 inline void script_file(lua_State* L, const std::string& filename, load_mode mode = load_mode::any) {
11823 if (luaL_loadfilex(L, filename.c_str(), to_string(mode).c_str()) || lua_pcall(L, 0, LUA_MULTRET, 0)) {

Callers 2

require_scriptMethod · 0.85
unsafe_scriptMethod · 0.85

Calls 5

make_chunk_nameFunction · 0.85
luaL_loadbufferxFunction · 0.85
c_strMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected