From b96b0b5abbf40cbdbed7952bf35a5a27ddf75928 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 16 Aug 2019 14:58:02 -0300 Subject: Added macro 'luaL_pushfail' The macro 'luaL_pushfail' documents all places in the standard libraries that return nil to signal some kind of failure. It is defined as 'lua_pushnil'. The manual also got a notation (@fail) to document those returns. The tests were changed to be agnostic regarding whether 'fail' is 'nil' or 'false'. --- lauxlib.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lauxlib.h') diff --git a/lauxlib.h b/lauxlib.h index f68f6af1..c50cdf4d 100644 --- a/lauxlib.h +++ b/lauxlib.h @@ -153,6 +153,10 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, #define luaL_loadbuffer(L,s,sz,n) luaL_loadbufferx(L,s,sz,n,NULL) +/* push the value used to represent failure/error */ +#define luaL_pushfail(L) lua_pushnil(L) + + /* ** {====================================================== ** Generic Buffer manipulation -- cgit v1.2.3-55-g6feb