-
Notifications
You must be signed in to change notification settings - Fork 91
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
Can not analyze symbols with Chinese #53
Comments
PUC Lua doesn't accept this code:
Aparently LuaJIT allows any octet ≥ 128 inside identifiers. (The documentation only says 'UTF-8' characters are supported, but nothing actually checks the encoding for validity, and a comment in the source code suggests that other encodings are meant to be supported as well.) That at least makes it simple to implement; I worried we might have to import the Unicode character database to check character properties or something. Well, sort of simple, because we parse Lua source code at the level of code points, not bytes, which brings back the conundrum I've had with interpreting string literals... Given that it's an extension from PUC Lua, I'll probably implement this, but it will require being explicitly enabled by the user, like with the goto skip
local goto = print
goto "hello"
::skip:: Supporting code like this might be too tricky to be worth it, so I explicitly don't promise that. |
Implemented in 7172940. Consider it unstable, however. I might still revisit the encoding issue. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I filed the encoding issue as #68. Another question that remains is whether to integrate this feature into the feature flags framework (i.e. the |
Apparently Lua 5.4 will add this feature behind a compile-time flag: lua/lua@e0ab13c. Although it seems that unlike LuaJIT only (modern) UTF-8 names will be supported. |
Can not analyze the Chinese function name, variable name, please add the analysis of Chinese function name and variable name support.
Luajit can support gbk or utf8 Chinese function name and variable name.
example
`
function 中文函数名(参数1,参数2)
local 中文变量 = "Chinese variable name"
end
The text was updated successfully, but these errors were encountered: