MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / doREPL

Function doREPL

libraries/AP_Scripting/lua/src/lua.c:406–419  ·  view source on GitHub ↗

** Do the REPL: repeatedly read (load) a line, evaluate (call) it, and ** print any results. */

Source from the content-addressed store, hash-verified

404** print any results.
405*/
406static void doREPL (lua_State *L) {
407 int status;
408 const char *oldprogname = progname;
409 progname = NULL; /* no 'progname' on errors in interactive mode */
410 while ((status = loadline(L)) != -1) {
411 if (status == LUA_OK)
412 status = docall(L, 0, LUA_MULTRET);
413 if (status == LUA_OK) l_print(L);
414 else report(L, status);
415 }
416 lua_settop(L, 0); /* clear stack */
417 lua_writeline();
418 progname = oldprogname;
419}
420
421
422/*

Callers 1

pmainFunction · 0.85

Calls 5

loadlineFunction · 0.85
docallFunction · 0.85
l_printFunction · 0.85
reportFunction · 0.85
lua_settopFunction · 0.85

Tested by

no test coverage detected