-
-
Notifications
You must be signed in to change notification settings - Fork 669
Support supplementary CPs in Unicode identifiers #2522
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
console.log(`const unicodeIdentifierStartMin = ${starts[0]};`); | ||
console.log(`const unicodeIdentifierStartMax = ${starts[starts.length - 1]};\n`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(`const unicodeIdentifierStartMin = ${starts[0]};`); | |
console.log(`const unicodeIdentifierStartMax = ${starts[starts.length - 1]};\n`); | |
console.log(`const UnicodeIdentifierStartMin = ${starts[0]};`); | |
console.log(`const UnicodeIdentifierStartMax = ${starts[starts.length - 1]};\n`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using title case for SomeEnum.SomeValue
seems fine, but just SomeValue
conflicts visually with classes, enums and interfaces. Not sure it's preferable?
Showed up in #2495, where 4-byte Unicode characters are not accepted as identifier starts/parts by the tokenizer. In TS, there exist maps for ES3, ES5 and ESNext, and I assume our current one matches the ES5 one. This PR adds a script we can use to generate the tables for ESNext (respectively: current Unicode tables used by Node), which should be the only relevant maps for us.
On our end, the respective maps are here. For ESNext, we'll need to go from
u16
tou32
since these values are codepoints.