@@ -26,11 +26,6 @@ extension Unicode.Scalar {
26
26
internal init ( _ scalar: Unicode . Scalar ) {
27
27
self . _scalar = scalar
28
28
}
29
-
30
- // Provide the value as UChar32 to make calling the ICU APIs cleaner
31
- internal var icuValue : __swift_stdlib_UChar32 {
32
- return __swift_stdlib_UChar32 ( bitPattern: self . _scalar. _value)
33
- }
34
29
}
35
30
36
31
/// Properties of this scalar defined by the Unicode standard.
@@ -1106,38 +1101,38 @@ extension Unicode {
1106
1101
/// [Unicode Standard](https://unicode.org/reports/tr44/#General_Category_Values).
1107
1102
case unassigned
1108
1103
1109
- internal init ( rawValue: __swift_stdlib_UCharCategory ) {
1104
+ internal init ( rawValue: UInt8 ) {
1110
1105
switch rawValue {
1111
- case __swift_stdlib_U_UNASSIGNED : self = . unassigned
1112
- case __swift_stdlib_U_UPPERCASE_LETTER : self = . uppercaseLetter
1113
- case __swift_stdlib_U_LOWERCASE_LETTER : self = . lowercaseLetter
1114
- case __swift_stdlib_U_TITLECASE_LETTER : self = . titlecaseLetter
1115
- case __swift_stdlib_U_MODIFIER_LETTER : self = . modifierLetter
1116
- case __swift_stdlib_U_OTHER_LETTER : self = . otherLetter
1117
- case __swift_stdlib_U_NON_SPACING_MARK : self = . nonspacingMark
1118
- case __swift_stdlib_U_ENCLOSING_MARK : self = . enclosingMark
1119
- case __swift_stdlib_U_COMBINING_SPACING_MARK : self = . spacingMark
1120
- case __swift_stdlib_U_DECIMAL_DIGIT_NUMBER : self = . decimalNumber
1121
- case __swift_stdlib_U_LETTER_NUMBER : self = . letterNumber
1122
- case __swift_stdlib_U_OTHER_NUMBER : self = . otherNumber
1123
- case __swift_stdlib_U_SPACE_SEPARATOR : self = . spaceSeparator
1124
- case __swift_stdlib_U_LINE_SEPARATOR : self = . lineSeparator
1125
- case __swift_stdlib_U_PARAGRAPH_SEPARATOR : self = . paragraphSeparator
1126
- case __swift_stdlib_U_CONTROL_CHAR : self = . control
1127
- case __swift_stdlib_U_FORMAT_CHAR : self = . format
1128
- case __swift_stdlib_U_PRIVATE_USE_CHAR : self = . privateUse
1129
- case __swift_stdlib_U_SURROGATE : self = . surrogate
1130
- case __swift_stdlib_U_DASH_PUNCTUATION : self = . dashPunctuation
1131
- case __swift_stdlib_U_START_PUNCTUATION : self = . openPunctuation
1132
- case __swift_stdlib_U_END_PUNCTUATION : self = . closePunctuation
1133
- case __swift_stdlib_U_CONNECTOR_PUNCTUATION : self = . connectorPunctuation
1134
- case __swift_stdlib_U_OTHER_PUNCTUATION : self = . otherPunctuation
1135
- case __swift_stdlib_U_MATH_SYMBOL : self = . mathSymbol
1136
- case __swift_stdlib_U_CURRENCY_SYMBOL : self = . currencySymbol
1137
- case __swift_stdlib_U_MODIFIER_SYMBOL : self = . modifierSymbol
1138
- case __swift_stdlib_U_OTHER_SYMBOL : self = . otherSymbol
1139
- case __swift_stdlib_U_INITIAL_PUNCTUATION : self = . initialPunctuation
1140
- case __swift_stdlib_U_FINAL_PUNCTUATION : self = . finalPunctuation
1106
+ case 0 : self = . uppercaseLetter
1107
+ case 1 : self = . lowercaseLetter
1108
+ case 2 : self = . titlecaseLetter
1109
+ case 3 : self = . modifierLetter
1110
+ case 4 : self = . otherLetter
1111
+ case 5 : self = . nonspacingMark
1112
+ case 6 : self = . spacingMark
1113
+ case 7 : self = . enclosingMark
1114
+ case 8 : self = . decimalNumber
1115
+ case 9 : self = . letterNumber
1116
+ case 10 : self = . otherNumber
1117
+ case 11 : self = . connectorPunctuation
1118
+ case 12 : self = . dashPunctuation
1119
+ case 13 : self = . openPunctuation
1120
+ case 14 : self = . closePunctuation
1121
+ case 15 : self = . initialPunctuation
1122
+ case 16 : self = . finalPunctuation
1123
+ case 17 : self = . otherPunctuation
1124
+ case 18 : self = . mathSymbol
1125
+ case 19 : self = . currencySymbol
1126
+ case 20 : self = . modifierSymbol
1127
+ case 21 : self = . otherSymbol
1128
+ case 22 : self = . spaceSeparator
1129
+ case 23 : self = . lineSeparator
1130
+ case 24 : self = . paragraphSeparator
1131
+ case 25 : self = . control
1132
+ case 26 : self = . format
1133
+ case 27 : self = . surrogate
1134
+ case 28 : self = . privateUse
1135
+ case 29 : self = . unassigned
1141
1136
default : fatalError ( " Unknown general category \( rawValue) " )
1142
1137
}
1143
1138
}
@@ -1171,10 +1166,7 @@ extension Unicode.Scalar.Properties {
1171
1166
/// This property corresponds to the "General_Category" property in the
1172
1167
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
1173
1168
public var generalCategory : Unicode . GeneralCategory {
1174
- let rawValue = __swift_stdlib_UCharCategory (
1175
- __swift_stdlib_UCharCategory. RawValue (
1176
- __swift_stdlib_u_getIntPropertyValue (
1177
- icuValue, __swift_stdlib_UCHAR_GENERAL_CATEGORY) ) )
1169
+ let rawValue = _swift_stdlib_getGeneralCategory ( _scalar. value)
1178
1170
return Unicode . GeneralCategory ( rawValue: rawValue)
1179
1171
}
1180
1172
}
0 commit comments