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').
This commit is contained in:
2
lapi.c
2
lapi.c
@@ -1207,7 +1207,7 @@ LUA_API int lua_next (lua_State *L, int idx) {
|
||||
}
|
||||
|
||||
|
||||
LUA_API void lua_tobeclosed (lua_State *L) {
|
||||
LUA_API void lua_toclose (lua_State *L) {
|
||||
int nresults = L->ci->nresults;
|
||||
luaF_newtbcupval(L, L->top - 1); /* create new to-be-closed upvalue */
|
||||
if (!hastocloseCfunc(nresults)) /* function not marked yet? */
|
||||
|
||||
Reference in New Issue
Block a user