MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / loadline

Function loadline

src/Chain/libraries/glua/lua.cpp:370–380  ·  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

368** in the top of the stack.
369*/
370static int loadline(lua_State *L) {
371 int status;
372 lua_settop(L, 0);
373 if (!pushline(L, 1))
374 return -1; /* no input */
375 if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */
376 status = multiline(L); /* try as command, maybe with continuation lines */
377 lua_remove(L, 1); /* remove line from the stack */
378 lua_assert(lua_gettop(L) == 1);
379 return status;
380}
381
382
383/*

Callers 1

doREPLFunction · 0.70

Calls 5

lua_settopFunction · 0.85
lua_gettopFunction · 0.85
pushlineFunction · 0.70
addreturnFunction · 0.70
multilineFunction · 0.70

Tested by

no test coverage detected