-
Notifications
You must be signed in to change notification settings - Fork 79
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
parser: unexpected token goto
#240
Comments
Hey @tami5 It looks like you have some Lua5.2+ code. How did you install stylua?
If you installed through GitHub releases or if this is from the GitHub action, then there may be something else wrong here |
🤨 I don't think neovim is running on lua52, luajit is which as far as I know it's basically lua51. Maybe support this syntax is supported in luajit 🤔. I'm not sure. |
Yes, LuaJIT includes some extensions from Lua 5.2, and in particular |
Thanks @clason, It would be cool to have a stylua version for luajit. |
The LuaJIT extensions should be covered in Lua 5.2 mode (mainly the goto and label syntax, which is the same in both). The only difference is when using In the case you showed though, this isn't an issue. Building with the Lua52 flag will work for your usecase |
Thanks @JohnnyMorganz! Can I configure https://github.com/JohnnyMorganz/stylua-action to use the |
It currently has all flags enabled (which hasn't proved a major issue thus far). Running it as-is should work |
Going a little bit off-issue (maybe), do you have any idea what can cause this error then? |
Hm, thats a strange one. Let me take a look further |
Ah, I see the issue. In your args: stylua --color always --check lua/ What this is essentially running is args: --color always --check lua/ Maybe the error message could be slightly easier to understand (Sorry for the delay, got distracted!) |
🤦🏼 Thanks a lot, that fixed it! |
😆 that was my bad, thanks @JohnnyMorganz . I guess this is no longer an issue |
Hello @JohnnyMorganz
I was trying to format the following file :
https://github.com/pwntester/octo.nvim/blob/master/lua/octo/model/octo-buffer.lua
but got the following message
Additionally, when I commented that line I got similar error related to
::continue::
more info pwntester/octo.nvim#193
The text was updated successfully, but these errors were encountered: