aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-05-09 12:10:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-05-09 12:10:31 -0300
commitd881325c2fcbb6d2c434ec403b0bbe51ac200c7b (patch)
tree811c1a1ffa8f91693b8df64e040c509c2cec6ded /lparser.c
parent3f253f116e8e292977a1bded964544fb35b3d1e3 (diff)
downloadlua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.tar.gz
lua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.tar.bz2
lua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.zip
Flag for to-be-closed variables changed to '<toclose>'
The flag for to-be-closed variables was changed from '*toclose' to '<toclose>'. Several people found confusing the old syntax and the new one has a clear terminator, making it more flexible for future changes.
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c3
1 files changed, 2 insertions, 1 deletions
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) {
1621 if (strcmp(getstr(attr), "toclose") != 0) 1621 if (strcmp(getstr(attr), "toclose") != 0)
1622 luaK_semerror(ls, 1622 luaK_semerror(ls,
1623 luaO_pushfstring(ls->L, "unknown attribute '%s'", getstr(attr))); 1623 luaO_pushfstring(ls->L, "unknown attribute '%s'", getstr(attr)));
1624 testnext(ls, '>');
1624 new_localvar(ls, str_checkname(ls)); 1625 new_localvar(ls, str_checkname(ls));
1625 checknext(ls, '='); 1626 checknext(ls, '=');
1626 exp1(ls); 1627 exp1(ls);
@@ -1634,7 +1635,7 @@ static void tocloselocalstat (LexState *ls) {
1634static void localstat (LexState *ls) { 1635static void localstat (LexState *ls) {
1635 /* stat -> LOCAL NAME {',' NAME} ['=' explist] 1636 /* stat -> LOCAL NAME {',' NAME} ['=' explist]
1636 | LOCAL *toclose NAME '=' exp */ 1637 | LOCAL *toclose NAME '=' exp */
1637 if (testnext(ls, '*')) 1638 if (testnext(ls, '<'))
1638 tocloselocalstat(ls); 1639 tocloselocalstat(ls);
1639 else 1640 else
1640 commonlocalstat(ls); 1641 commonlocalstat(ls);