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

Support unicode character please #128

Open
fy0 opened this issue Feb 13, 2022 · 2 comments
Open

Support unicode character please #128

fy0 opened this issue Feb 13, 2022 · 2 comments

Comments

@fy0
Copy link

fy0 commented Feb 13, 2022

Most of modern programing languages already allows unicode variables names, please add this feature.
Thanks to contributors for the great work.

@fy0
Copy link
Author

fy0 commented Feb 13, 2022

Temporary solution:

Read file to buffer, and convert to ascii

strconv.QuoteToASCII(buffer)

Then use:


Identifier <- ![0-9] (UniversalCharacter / [0-9a-zA-Z_])+


#-------------------------------------------------------------------------
#  A.1.4  Universal character names
#-------------------------------------------------------------------------

UniversalCharacter
   <- '\\u' HexQuad
    / '\\U' HexQuad HexQuad

HexQuad <- HexDigit HexDigit HexDigit HexDigit

HexDigit        <- [a-f] / [A-F] / [0-9]

@flowchartsman
Copy link

This would be really swell; I was evaluating this as a replacement for pigeon, but the grammar I was working on allows for unicode identifiers, and I'd rather not have to use an awkward workaround.

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