diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-09 12:10:31 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-09 12:10:31 -0300 |
| commit | d881325c2fcbb6d2c434ec403b0bbe51ac200c7b (patch) | |
| tree | 811c1a1ffa8f91693b8df64e040c509c2cec6ded /lparser.c | |
| parent | 3f253f116e8e292977a1bded964544fb35b3d1e3 (diff) | |
| download | lua-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -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) { | |||
| 1634 | static void localstat (LexState *ls) { | 1635 | static 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); |
