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

[feature request] add support for unicode identifier for variable name #145

Open
pigpigyyy opened this issue Aug 17, 2023 · 1 comment
Open

Comments

@pigpigyyy
Copy link
Owner

pigpigyyy commented Aug 17, 2023

A request from Discord:
I wanna be able to do stuff like

💬 'OK OK OK', 'god dammit', 23
📡 = require'satellite'

in no way is this an incredibly important or helpful idea, but i would be happy to use it if it existed.

@pigpigyyy
Copy link
Owner Author

Added unicode identifier support for variable names, table indexing, goto labels, macro names and other syntax that can be possible via commit e61cce2.
The code

💬 = print
💬 'OK OK OK', 'god dammit', 23
📡 = require'satellite'

will be compiled to:

local _ud83d_udcac = print
_ud83d_udcac('OK OK OK', 'god dammit', 23)
local _ud83d_udce1 = require('satellite')

And that will leave a problem when you are using unicode names for global variables:

global 🌛 = "moon"
assert _G.🌛 == 🌛, "can not access this global variable with the unicode name"

compiles:

_ud83c_udf1b = "moon"
return assert(_G["🌛"] == _ud83c_udf1b, "can not access this global variable with the unicode name")

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

1 participant