summaryrefslogtreecommitdiff
path: root/lauxlib.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-16 14:58:02 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-16 14:58:02 -0300
commitb96b0b5abbf40cbdbed7952bf35a5a27ddf75928 (patch)
tree5d9d5463cb7d3424833abab20dd87bce1f4b240f /lauxlib.h
parentca13be9af784b7288d3a07d9b5bccb329086e885 (diff)
downloadlua-github-b96b0b5abbf40cbdbed7952bf35a5a27ddf75928.tar.gz
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'.
Diffstat (limited to 'lauxlib.h')
-rw-r--r--lauxlib.h4
1 files changed, 4 insertions, 0 deletions
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