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

Support Lua5.4 local var attributes like <const> ? #533

Closed
will opened this issue Aug 14, 2022 · 2 comments · Fixed by #576
Closed

Support Lua5.4 local var attributes like <const> ? #533

will opened this issue Aug 14, 2022 · 2 comments · Fixed by #576
Labels
enhancement New feature or request external This issue relies on an external factor

Comments

@will
Copy link

will commented Aug 14, 2022

https://www.lua.org/manual/5.4/manual.html#3.3.7

In 5.4 you can say things like local color_type <const> = type(color) but stylua can't parse the <

error: could not format file ./modules/NobleScene.lua: error parsing: error occurred while creating ast: unexpected token `<`. (starting from line 187, character 14 and ending on line 187, character 15)
additional information: expected 'end'
@will will changed the title Support Lua5.4 local declarations like <const> ? Support Lua5.4 local var attributes like <const> ? Aug 14, 2022
@JohnnyMorganz
Copy link
Owner

This requires 5.4 support in full-moon which is the parser we use. It currently only supports up to 5.2

Once that is added, I'm happy to support this in stylua

@JohnnyMorganz JohnnyMorganz added enhancement New feature or request external This issue relies on an external factor labels Aug 14, 2022
@will
Copy link
Author

will commented Sep 25, 2022

Just had a chance to check this out. Works great for Playdate lua games. Thanks for this and for doing the work in full-moon!

I posted about this at the playdate forum just to spread the word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request external This issue relies on an external factor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants