From d881325c2fcbb6d2c434ec403b0bbe51ac200c7b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 9 May 2019 12:10:31 -0300 Subject: Flag for to-be-closed variables changed to '' The flag for to-be-closed variables was changed from '*toclose' to ''. Several people found confusing the old syntax and the new one has a clear terminator, making it more flexible for future changes. --- lparser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lparser.c') diff --git a/lparser.c b/lparser.c index 4c2ddbfe..4e6c27fe 100644 --- a/lparser.c +++ b/lparser.c @@ -1621,6 +1621,7 @@ static void tocloselocalstat (LexState *ls) { if (strcmp(getstr(attr), "toclose") != 0) luaK_semerror(ls, luaO_pushfstring(ls->L, "unknown attribute '%s'", getstr(attr))); + testnext(ls, '>'); new_localvar(ls, str_checkname(ls)); checknext(ls, '='); exp1(ls); @@ -1634,7 +1635,7 @@ static void tocloselocalstat (LexState *ls) { static void localstat (LexState *ls) { /* stat -> LOCAL NAME {',' NAME} ['=' explist] | LOCAL *toclose NAME '=' exp */ - if (testnext(ls, '*')) + if (testnext(ls, '<')) tocloselocalstat(ls); else commonlocalstat(ls); -- cgit v1.2.3-55-g6feb