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

JS scanner considers Cyrillic and Chinese variable names as errors #172

Open
JasonBarnabe opened this issue May 30, 2014 · 5 comments
Open
Assignees
Milestone

Comments

@JasonBarnabe
Copy link

This runs with no problem:

var  = 1;
var Ы = 2;
alert(+Ы);

But CodeRay thinks there's errors. (Hey, so does Github!)

@korny
Copy link
Member

korny commented May 31, 2014

You're right, the JavaScript scanner allows only the standard (Englisch) ASCII alphabet. But Firefox and Safari both accept your code. I'm going to change this in 1.2.

@korny
Copy link
Member

korny commented May 31, 2014

Mozilla writes:

Starting with JavaScript 1.5, you can use ISO 8859-1 or Unicode letters such as å and ü in identifiers. You can also use the \uXXXX Unicode escape sequences as characters in identifiers.

Pygments doesn't agree:

\u1212 = 4
\u1212(\u1212)

Also:

JavaScript 1.5 was introduced back in 1999.

Wow, I missed that :P

@JasonBarnabe
Copy link
Author

@CoolCmd
Copy link

CoolCmd commented Jun 3, 2014

P.S.
HTML "id" attributes and CSS class names also allows unicode characters. Very few people know about that.

@JasonBarnabe
Copy link
Author

#174 for a fix.

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

No branches or pull requests

3 participants