mirror of
https://github.com/corda/corda.git
synced 2025-02-01 08:48:09 +00:00
Added Character.isJavaIdentifierStart(int), isJavaIdentifierPart(int) and made isJavaIdentifierStart(char), isJavaIdentifierPart(char) more compact.
This commit is contained in:
parent
ab3ee4c6e2
commit
6f8a8b9436
@ -175,32 +175,22 @@ public final class Character implements Comparable<Character> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isJavaIdentifierStart(char ch) {
|
public static boolean isJavaIdentifierStart(char ch) {
|
||||||
if (isLetter(ch)){
|
return isLetter(ch) || ch == '$' || ch == '_';
|
||||||
return true;
|
//TODO: add if (getType(ch)==LETTER_NUMBER) || getType(ch)==CURRENCY_SYMBOL
|
||||||
}
|
}
|
||||||
if (ch == '$'){ //TODO: if (getType(ch)==CURRENCY_SYMBOL)
|
|
||||||
return true;
|
public static boolean isJavaIdentifierStart(int c) {
|
||||||
}
|
return canCastToChar(c) && isJavaIdentifierStart((char) c);
|
||||||
if (ch == '_'){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//TODO: if (getType(ch)==LETTER_NUMBER) return true
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isJavaIdentifierPart(char ch) {
|
public static boolean isJavaIdentifierPart(char ch) {
|
||||||
if (isJavaIdentifierStart(ch)){
|
return isJavaIdentifierStart(ch) || isDigit(ch);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (isDigit(ch)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO:Check for numeric letters (such as a Roman numeral character),combining marks,non-spacing marks
|
//TODO:Check for numeric letters (such as a Roman numeral character),combining marks,non-spacing marks
|
||||||
//if (isIdentifierIgnorable(ch)) return true
|
//add isIdentifierIgnorable(ch)
|
||||||
|
}
|
||||||
return false;
|
|
||||||
|
public static boolean isJavaIdentifierPart(int c) {
|
||||||
|
return canCastToChar(c) && isJavaIdentifierPart((char) c);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int toCodePoint(char high, char low) {
|
public static int toCodePoint(char high, char low) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user