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