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

Function runargs

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

Source from the content-addressed store, hash-verified

393
394
395static int runargs (lua_State *L, char **argv, int n) {
396 int i;
397 for (i = 1; i < n; i++) {
398 lua_assert(argv[i][0] == '-');
399 switch (argv[i][1]) { /* option */
400 case 'e': {
401 const char *chunk = argv[i] + 2;
402 if (*chunk == '\0') chunk = argv[++i];
403 lua_assert(chunk != NULL);
404 if (dostring(L, chunk, "=(command line)") != LUA_OK)
405 return 0;
406 break;
407 }
408 case 'l': {
409 const char *filename = argv[i] + 2;
410 if (*filename == '\0') filename = argv[++i];
411 lua_assert(filename != NULL);
412 if (dolibrary(L, filename) != LUA_OK)
413 return 0; /* stop if file fails */
414 break;
415 }
416 default: break;
417 }
418 }
419 return 1;
420}
421
422
423static int handle_luainit (lua_State *L) {

Callers 1

pmainFunction · 0.70

Calls 2

dostringFunction · 0.70
dolibraryFunction · 0.70

Tested by

no test coverage detected