summaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-11-07 10:03:05 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-11-07 10:03:05 -0200
commitb8fed93215a23a3f443c5b0126f0de1725771b44 (patch)
tree1d7d29388b8a20fb7d0920d94b02a8040612314d /lapi.c
parent5e76a4fd313a8690d300085c4e8fcb9dca50c01a (diff)
downloadlua-b8fed93215a23a3f443c5b0126f0de1725771b44.tar.gz
lua-b8fed93215a23a3f443c5b0126f0de1725771b44.tar.bz2
lua-b8fed93215a23a3f443c5b0126f0de1725771b44.zip
New syntax for to-be-closed variables
The new syntax is <local *toclose x = f()>. The mark '*' allows other attributes to be added later without the need of new keywords; it also allows better error messages. The API function was also renamed ('lua_tobeclosed' -> 'lua_toclose').
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 4fef43b7..91a6e389 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1207,7 +1207,7 @@ LUA_API int lua_next (lua_State *L, int idx) {
1207} 1207}
1208 1208
1209 1209
1210LUA_API void lua_tobeclosed (lua_State *L) { 1210LUA_API void lua_toclose (lua_State *L) {
1211 int nresults = L->ci->nresults; 1211 int nresults = L->ci->nresults;
1212 luaF_newtbcupval(L, L->top - 1); /* create new to-be-closed upvalue */ 1212 luaF_newtbcupval(L, L->top - 1); /* create new to-be-closed upvalue */
1213 if (!hastocloseCfunc(nresults)) /* function not marked yet? */ 1213 if (!hastocloseCfunc(nresults)) /* function not marked yet? */