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

Function handle_script

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

Source from the content-addressed store, hash-verified

324
325
326static int handle_script (lua_State *L, char **argv, int n) {
327 int status;
328 const char *fname;
329 int narg = getargs(L, argv, n); /* collect arguments */
330 lua_setglobal(L, "arg");
331 fname = argv[n];
332 if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0)
333 fname = NULL; /* stdin */
334 status = luaL_loadfile(L, fname);
335 lua_insert(L, -(narg+1));
336 if (status == LUA_OK)
337 status = docall(L, narg, LUA_MULTRET);
338 else
339 lua_pop(L, narg);
340 return report(L, status);
341}
342
343
344/* check that argument has no extra characters at the end */

Callers 1

pmainFunction · 0.70

Calls 6

luaL_loadfileFunction · 0.85
getargsFunction · 0.70
lua_setglobalFunction · 0.70
lua_insertFunction · 0.70
docallFunction · 0.70
reportFunction · 0.70

Tested by

no test coverage detected