@@ -917,49 +917,10 @@ private static boolean isCombiningMark(char ch) {
917
917
// FE20–FE2F
918
918
(0xFE20 <= ch & ch <= 0xFE2F )
919
919
);
920
- // TODO (ctjl): Implement in a more reliable and future-proofed way, i.e.:
921
- // return Character.getType(ch) == Character.NON_SPACING_MARK;
922
- }
923
-
924
- // TODO (ctjl): Implement
925
- private static boolean isConnectorPunctuation () {
926
- return true ;
927
- }
928
-
929
- // TODO (ctjl): Implement
930
- private static boolean isZeroWidthJoiner () {
931
- return true ;
932
- }
933
-
934
- // TODO (ctjl): Implement
935
- private static boolean isZeroWidthNonJoiner () {
936
- return true ;
937
920
}
938
921
939
922
@ SuppressWarnings ("ShortCircuitBoolean" ) // Intentional to minimize branches in this code
940
923
private static boolean isIdentifierPart (char ch ) {
941
- /**
942
- https://www.ecma-international.org/ecma-262/5.1/#sec-7.6
943
- IdentifierPart ::
944
- IdentifierStart
945
- ✓ isIdentifierPart()
946
-
947
- UnicodeCombiningMark
948
- ✓ isCombiningMark()
949
-
950
- UnicodeDigit
951
- ✓ Character.isDigit()
952
-
953
- UnicodeConnectorPunctuation
954
- ✓ isConnectorPunctuation()
955
-
956
- <ZWNJ>
957
- ✓ isZeroWidthNonJoiner()
958
-
959
- <ZWJ>
960
- ✓ isZeroWidthJoiner()
961
- */
962
-
963
924
// Most code is written in pure ASCII, so create a fast path here.
964
925
if (ch <= 127 ) {
965
926
return ((ch >= 'A' & ch <= 'Z' )
@@ -970,7 +931,7 @@ private static boolean isIdentifierPart(char ch) {
970
931
971
932
// Handle non-ASCII characters.
972
933
// TODO(tjgq): This should include all characters with the ID_Continue property, plus
973
- // TODO(ctjl): Implement remaining grammar (zero-width joiners, etc.)
934
+ // Zero Width Non-Joiner and Zero Width Joiner.
974
935
return isIdentifierStart (ch )
975
936
|| isCombiningMark (ch )
976
937
|| Character .isDigit (ch );
0 commit comments