** 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. */
| 549 | ** in the top of the stack. |
| 550 | */ |
| 551 | static int loadline (lua_State *L) { |
| 552 | int status; |
| 553 | lua_settop(L, 0); |
| 554 | if (!pushline(L, 1)) |
| 555 | return -1; /* no input */ |
| 556 | if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ |
| 557 | status = multiline(L); /* try as command, maybe with continuation lines */ |
| 558 | lua_remove(L, 1); /* remove line from the stack */ |
| 559 | lua_assert(lua_gettop(L) == 1); |
| 560 | return status; |
| 561 | } |
| 562 | |
| 563 | |
| 564 | /* |
no test coverage detected