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

Function handle_script

src/lua.cpp:265–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263
264
265static int handle_script (lua_State *L, char **argv) {
266 int status;
267 const char *fname = argv[0];
268 if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0)
269 fname = NULL; /* stdin */
270 status = luaL_loadfile(L, fname);
271 if (status == LUA_OK) {
272 int n = pushargs(L); /* push arguments to script */
273 status = docall(L, n, LUA_MULTRET);
274 }
275 return report(L, status);
276}
277
278
279/* bits of various argument indicators in 'args' */

Callers 1

pmainFunction · 0.85

Calls 3

pushargsFunction · 0.85
docallFunction · 0.85
reportFunction · 0.85

Tested by

no test coverage detected