Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Lua 5.4 syntax #5

Open
GavinHigham opened this issue Oct 28, 2022 · 0 comments
Open

Add support for Lua 5.4 syntax #5

GavinHigham opened this issue Oct 28, 2022 · 0 comments
Assignees
Labels

Comments

@GavinHigham
Copy link
Owner

Lua 5.4 replaces namelist with attnamelist.

In Lua 5.3, one possible statement ("stat") is local namelist [‘=’ explist] .
In Lua 5.4 this is now local attnamelist [‘=’ explist].

In Lua 5.3, "namelist" is namelist ::= Name {‘,’ Name}.
In Lua 5.4, "attnamelist" is attnamelist ::= Name attrib {‘,’ Name attrib} with
attrib ::= [‘<’ Name ‘>’].

Essentially, where before you could have a local comma-separated list of names, now you can have a local comma-separated list of names, with an optional attribute for each (to support the "const" and "close" attributes). The syntax itself does not enforce what is or isn't a valid attribute, except that it must be a terminal Name.

Before:
local apple, carrot = 'fruit', 'vegetable'
After:
local apple <const>, carrot = 'fruit', 'vegetable'

@GavinHigham GavinHigham self-assigned this Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant