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:
Roberto Ierusalimschy
2018-11-07 10:03:05 -02:00
parent 5e76a4fd31
commit b8fed93215
8 changed files with 48 additions and 47 deletions

View File

@@ -1550,8 +1550,8 @@ static struct X { int x; } x;
int i = getindex;
return lua_yieldk(L1, nres, i, Cfunck);
}
else if EQ("tobeclosed") {
lua_tobeclosed(L);
else if EQ("toclose") {
lua_toclose(L);
}
else luaL_error(L, "unknown instruction %s", buff);
}