** 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. */
| 370 | ** in the top of the stack. |
| 371 | */ |
| 372 | static int loadline (lua_State *L) { |
| 373 | int status; |
| 374 | lua_settop(L, 0); |
| 375 | if (!pushline(L, 1)) |
| 376 | return -1; /* no input */ |
| 377 | if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ |
| 378 | status = multiline(L); /* try as command, maybe with continuation lines */ |
| 379 | lua_remove(L, 1); /* remove line from the stack */ |
| 380 | lua_assert(lua_gettop(L) == 1); |
| 381 | return status; |
| 382 | } |
| 383 | |
| 384 | |
| 385 | /* |
no test coverage detected