@@ -44,6 +44,8 @@ SuppDataBytesOffset = 12817
44
44
45
45
import SwiftShims
46
46
47
+ // These case names must be kept in sync with the 'GraphemeClusterBreakProperty'
48
+ // enum in C++ and with the names in the GYBUnicodeDataUtils script.
47
49
public // @testable
48
50
enum _GraphemeClusterBreakPropertyValue : Int {
49
51
case Other = 0
@@ -107,31 +109,31 @@ struct _UnicodeGraphemeClusterBreakPropertyTrie {
107
109
let _trieData : UnsafePointer < UInt8 >
108
110
109
111
% if BMPLookupBytesPerEntry == 1 :
110
- @_transparent var _BMPLookup : UnsafePointer < UInt8 > {
112
+ @_transparent var _bmpLookup : UnsafePointer < UInt8 > {
111
113
return _trieData + ${ BMPLookupBytesOffset}
112
114
}
113
115
% end
114
116
115
117
% if BMPDataBytesPerEntry == 1 :
116
- @_transparent var _BMPData : UnsafePointer < UInt8 > {
118
+ @_transparent var _bmpData : UnsafePointer < UInt8 > {
117
119
return _trieData + ${ BMPDataBytesOffset}
118
120
}
119
121
% end
120
122
121
123
% if SuppLookup1 BytesPerEntry == 1 :
122
- @_transparent var _SuppLookup1 : UnsafePointer < UInt8 > {
124
+ @_transparent var _suppLookup1 : UnsafePointer < UInt8 > {
123
125
return _trieData + ${ SuppLookup1BytesOffset}
124
126
}
125
127
% end
126
128
127
129
% if SuppLookup2 BytesPerEntry == 1 :
128
- @_transparent var _SuppLookup2 : UnsafePointer < UInt8 > {
130
+ @_transparent var _suppLookup2 : UnsafePointer < UInt8 > {
129
131
return _trieData + ${ SuppLookup2BytesOffset}
130
132
}
131
133
% end
132
134
133
135
% if SuppDataBytesPerEntry == 1 :
134
- @_transparent var _SuppData : UnsafePointer < UInt8 > {
136
+ @_transparent var _suppData : UnsafePointer < UInt8 > {
135
137
return _trieData + ${ SuppDataBytesOffset}
136
138
}
137
139
% end
@@ -184,19 +186,19 @@ struct _UnicodeGraphemeClusterBreakPropertyTrie {
184
186
// if '+' is used.
185
187
186
188
if _fastPath ( codePoint <= 0xffff ) {
187
- let dataBlockIndex = Int ( _BMPLookup [ _getBMPFirstLevelIndex ( codePoint) ] )
189
+ let dataBlockIndex = Int ( _bmpLookup [ _getBMPFirstLevelIndex ( codePoint) ] )
188
190
return _GraphemeClusterBreakPropertyRawValue (
189
- _BMPData [
191
+ _bmpData [
190
192
( dataBlockIndex << ${ BMPDataOffsetBits} ) &+
191
193
_getBMPDataOffset ( codePoint) ] )
192
194
} else {
193
195
_precondition ( codePoint <= 0x10ffff )
194
- let secondLookupIndex = Int ( _SuppLookup1 [ _getSuppFirstLevelIndex ( codePoint) ] )
195
- let dataBlockIndex = Int ( _SuppLookup2 [
196
+ let secondLookupIndex = Int ( _suppLookup1 [ _getSuppFirstLevelIndex ( codePoint) ] )
197
+ let dataBlockIndex = Int ( _suppLookup2 [
196
198
( secondLookupIndex << ${ SuppSecondLevelIndexBits} ) &+
197
199
_getSuppSecondLevelIndex ( codePoint) ] )
198
200
return _GraphemeClusterBreakPropertyRawValue (
199
- _SuppData [
201
+ _suppData [
200
202
( dataBlockIndex << ${ SuppDataOffsetBits} ) &+
201
203
_getSuppDataOffset ( codePoint) ] )
202
204
}
0 commit comments