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

luacheck doesn't allow non-ascii symbols in unquoted strings #207

Closed
ligurio opened this issue Nov 10, 2020 · 3 comments
Closed

luacheck doesn't allow non-ascii symbols in unquoted strings #207

ligurio opened this issue Nov 10, 2020 · 3 comments

Comments

@ligurio
Copy link

ligurio commented Nov 10, 2020

non-ascii symbols in Привет = 1 triggers error in luacheck:

Checking r.lua                                    1 error

    r.lua:1:1: expected statement near 'П'

Total: 0 warnings / 1 error in 1 file

To workaround one can use quotes: ['Привет'] = 1.

Luacheck: 0.23.0
Lua: LuaJIT 2.1.0-beta3
Argparse: 0.6.0

@alerque
Copy link

alerque commented Oct 7, 2021

This isn't an error in luacheck, this is something that Lua itself does not allow:

$ lua -e 'Привет = 1'         
lua: (command line):1: unexpected symbol near '<\208>'

Quoting it as table key is the correct idiomatic solution.

You may not be aware but the original maintainer of this project passed away (see #198). since nobody is able to close issues here except the people that opened them I would request your help tidying up by closing this issue.

If you feel there is something that needs more attention or something Lua allows that isn't being caught please open an issue on the new official repository here.

@ligurio
Copy link
Author

ligurio commented Oct 8, 2021

This isn't an error in luacheck, this is something that Lua itself does not allow:

It is valid for PUC Rio Lua, LuaJIT allow to use it.

$ luajit -v
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
$ luajit -e 'Привет = 1'  
$ luajit -e 'Привет = 1 print(Привет)'  
1
$ 

@alerque
Copy link

alerque commented Oct 8, 2021

Well that's interesting, and something I didn't know about LuaJIT!

My other point still stands, we have no access to manage issues on this repository. Can you please copy the relevant info from above into a new issue here and close this one? We can look into how to accommodate different interpreter handling there. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants