-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add full Unicode support for Javascript identifiers #3647
Open
ctjlewis
wants to merge
30
commits into
google:master
Choose a base branch
from
ctjlewis:unicode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5ad0744
Added support for UnicodeCombiningMark, fixes #3639.
ctjlewis 93ed59e
Removed unnecessary test script, moved scripts to utils/.
ctjlewis 7d2ea29
Added newlines for formatting
ctjlewis 3c5ee21
Patched isCombiningMark to check Unicode space manually rather than r…
ctjlewis b3a720c
Added bazel output symlinks to .gitignore and removed from tree.
ctjlewis 590f2dc
Removed unneeded java.lang.Character import.
ctjlewis 1ecfd75
Removed unneeded test.js.
ctjlewis e1d5129
Merge remote-tracking branch 'upstream/master'
ctjlewis 696e201
Adding support for non-ASCII Unicode.
ctjlewis 0d25c89
Added .vscode to .gitignore.
ctjlewis f2f02e3
Added note about regexpu.
ctjlewis a8e9e95
Fixed test re. U+FF3F, which is now supported.
ctjlewis 813797b
Added more notes on regex patterns used.
ctjlewis 8fefd7d
Inlined calls to UnicodeMatch utils.
ctjlewis 78700f2
UnicodeMatch to public class, prevent build failure
ctjlewis da68979
Merge branch 'master' into unicode
ctjlewis ad71a90
Changed isIdentifierPart and isIdentifierStart arg types from char to…
ctjlewis 4372212
Added comment about branch prediction misses
ctjlewis 066eaba
Clarified comments and added `fastPathAscii`
ctjlewis 8c7c040
Re-added fastPath Greek/Latin checks until further advisement
ctjlewis 72d6ce8
Reverting fastPathAscii check until further advisement
ctjlewis 7e83d4f
Refactored fast paths
ctjlewis 2f69388
Removed debugging utils/ directory
ctjlewis dc275d2
Comment formatting
ctjlewis bd26958
Fixed string/char error
ctjlewis 5fb993f
Comment formatting
ctjlewis 8ab20b7
Committing changes before push to remote.
ctjlewis cb50fe1
Explicit typecast to char for `Character.toString()`
ctjlewis 469265f
Updated fast paths for ASCII optimization
ctjlewis 6d9f04e
Comment formatting
ctjlewis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
174 changes: 174 additions & 0 deletions
174
src/com/google/javascript/jscomp/parsing/parser/util/UnicodeMatch.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do you feel this is insufficient for the native Java builds? Where do you believe you need the JavaScript version?
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.
@concavelenz I believe the reason I removed
Character.isLetter
was because the GWT build would not work for non-ASCII unicode, due to limitations of J2CL / Guava implementations of those methods. See: google/j2cl#103Apologies for the lack of specificity, this issue is about a month old and is not super fresh in my mind. Thank you for your reviews, John.