** 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. */
| 568 | ** in the top of the stack. |
| 569 | */ |
| 570 | static int loadline (lua_State *L) { |
| 571 | int status; |
| 572 | lua_settop(L, 0); |
| 573 | if (!pushline(L, 1)) |
| 574 | return -1; /* no input */ |
| 575 | if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ |
| 576 | status = multiline(L); /* try as command, maybe with continuation lines */ |
| 577 | lua_remove(L, 1); /* remove line from the stack */ |
| 578 | lua_assert(lua_gettop(L) == 1); |
| 579 | return status; |
| 580 | } |
| 581 | |
| 582 | |
| 583 | /* |
no test coverage detected