** 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. */
| 382 | ** in the top of the stack. |
| 383 | */ |
| 384 | static int loadline(lua_State *L) { |
| 385 | int status; |
| 386 | lua_settop(L, 0); |
| 387 | if (!pushline(L, 1)) |
| 388 | return -1; /* no input */ |
| 389 | if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ |
| 390 | status = multiline(L); /* try as command, maybe with continuation lines */ |
| 391 | glua_pending_source = ""; |
| 392 | lua_remove(L, 1); /* remove line from the stack */ |
| 393 | lua_assert(lua_gettop(L) == 1); |
| 394 | return status; |
| 395 | } |
| 396 | |
| 397 | |
| 398 | /* |
no test coverage detected