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

Function loadline

third-party/lua-5.4.6/src/lua.c:569–579  ·  view source on GitHub ↗

** Read a line and try to load (compile) it first as an expression (by ** adding "return " in front of it) and second as a statement. Return ** the final status of load/call with the resulting function (if any) ** in the top of the stack. */

Source from the content-addressed store, hash-verified

567** in the top of the stack.
568*/
569static int loadline (lua_State *L) {
570 int status;
571 lua_settop(L, 0);
572 if (!pushline(L, 1))
573 return -1; /* no input */
574 if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */
575 status = multiline(L); /* try as command, maybe with continuation lines */
576 lua_remove(L, 1); /* remove line from the stack */
577 lua_assert(lua_gettop(L) == 1);
578 return status;
579}
580
581
582/*

Callers 1

doREPLFunction · 0.70

Calls 6

lua_settopFunction · 0.70
pushlineFunction · 0.70
addreturnFunction · 0.70
multilineFunction · 0.70
lua_gettopFunction · 0.70
lua_removeFunction · 0.50

Tested by

no test coverage detected