** 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. */
| 517 | ** in the top of the stack. |
| 518 | */ |
| 519 | static int loadline (lua_State *L) { |
| 520 | int status; |
| 521 | lua_settop(L, 0); |
| 522 | if (!pushline(L, 1)) |
| 523 | return -1; /* no input */ |
| 524 | if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ |
| 525 | status = multiline(L); /* try as command, maybe with continuation lines */ |
| 526 | lua_remove(L, 1); /* remove line from the stack */ |
| 527 | lua_assert(lua_gettop(L) == 1); |
| 528 | return status; |
| 529 | } |
| 530 | |
| 531 | |
| 532 | /* |
no test coverage detected