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

Function loadline

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

Source from the content-addressed store, hash-verified

279
280
281static int loadline (lua_State *L) {
282 int status;
283 lua_settop(L, 0);
284 if (!pushline(L, 1))
285 return -1; /* no input */
286 for (;;) { /* repeat until gets a complete line */
287 size_t l;
288 const char *line = lua_tolstring(L, 1, &l);
289 status = luaL_loadbuffer(L, line, l, "=stdin");
290 if (!incomplete(L, status)) break; /* cannot try to add lines? */
291 if (!pushline(L, 0)) /* no more input? */
292 return -1;
293 lua_pushliteral(L, "\n"); /* add a new line... */
294 lua_insert(L, -2); /* ...between the two lines */
295 lua_concat(L, 3); /* join them */
296 }
297 lua_saveline(L, 1);
298 lua_remove(L, 1); /* remove line */
299 return status;
300}
301
302
303static void dotty (lua_State *L) {

Callers 1

dottyFunction · 0.70

Calls 9

luaL_loadbufferFunction · 0.85
lua_savelineFunction · 0.85
lua_settopFunction · 0.70
pushlineFunction · 0.70
lua_tolstringFunction · 0.70
incompleteFunction · 0.70
lua_insertFunction · 0.70
lua_concatFunction · 0.70
lua_removeFunction · 0.70

Tested by

no test coverage detected