** 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. */
| 413 | ** in the top of the stack. |
| 414 | */ |
| 415 | static int loadline(lua_State *L) { |
| 416 | int status; |
| 417 | lua_settop(L, 0); |
| 418 | if (!pushline(L, 1)) |
| 419 | return -1; /* no input */ |
| 420 | if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ |
| 421 | status = multiline(L); /* try as command, maybe with continuation lines */ |
| 422 | lua_remove(L, 1); /* remove line from the stack */ |
| 423 | lua_assert(lua_gettop(L) == 1); |
| 424 | return status; |
| 425 | } |
| 426 | |
| 427 | /* |
| 428 | ** Do the REPL: repeatedly read (load) a line, evaluate (call) it, and |
no test coverage detected