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

Format errors with goto as a function #229

Closed
mgutz opened this issue Jul 19, 2021 · 3 comments · Fixed by #286
Closed

Format errors with goto as a function #229

mgutz opened this issue Jul 19, 2021 · 3 comments · Fixed by #286
Labels
bug Something isn't working external This issue relies on an external factor

Comments

@mgutz
Copy link

mgutz commented Jul 19, 2021

Stylua version: v0.10.0
Linux binary download

This doesn't format. Doesn't like the goto.

local f = function()
-- cannot use goto as function identifier
self.goto(bufnr)
end
error: could not walk: lab/neostack-modules/lua/neostack-modules/mru_buffers/mru2_man.lua: IO error for operation on lab/neostack-modules/lua/neostack-modules/mru_buffers/mru2_man.lua: No such file or directory (os error 2)
@JohnnyMorganz JohnnyMorganz added bug Something isn't working external This issue relies on an external factor labels Jul 19, 2021
@JohnnyMorganz
Copy link
Owner

JohnnyMorganz commented Jul 19, 2021

This seems to be an issue in our parsing library (full-moon) where goto has been restricted as a symbol for Lua 5.2, but this has leaked into non-Lua5.2 parsing.

Just to confirm: this is part of a Lua 5.1 codebase right? I'm pretty sure goto used as a variable/function name isn't allowed in 5.2+, but I might be wrong.

@mgutz
Copy link
Author

mgutz commented Jul 19, 2021

Yes, it's 5.1 embedded in neovim.

@bugabinga
Copy link

This is most likely because neovim uses LuaJIT, which defines some extensions to Lua 5.1.
goto was introduced in Lua 5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external This issue relies on an external factor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants