MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / loadline

Function loadline

deps/lua/src/lua.c:196–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195
196static int loadline (lua_State *L) {
197 int status;
198 lua_settop(L, 0);
199 if (!pushline(L, 1))
200 return -1; /* no input */
201 for (;;) { /* repeat until gets a complete line */
202 status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), "=stdin");
203 if (!incomplete(L, status)) break; /* cannot try to add lines? */
204 if (!pushline(L, 0)) /* no more input? */
205 return -1;
206 lua_pushliteral(L, "\n"); /* add a new line... */
207 lua_insert(L, -2); /* ...between the two lines */
208 lua_concat(L, 3); /* join them */
209 }
210 lua_saveline(L, 1);
211 lua_remove(L, 1); /* remove line */
212 return status;
213}
214
215
216static void dotty (lua_State *L) {

Callers 1

dottyFunction · 0.85

Calls 7

lua_settopFunction · 0.85
pushlineFunction · 0.85
luaL_loadbufferFunction · 0.85
incompleteFunction · 0.85
lua_insertFunction · 0.85
lua_concatFunction · 0.85
lua_removeFunction · 0.85

Tested by

no test coverage detected