File tree 3 files changed +1040
-968
lines changed 3 files changed +1040
-968
lines changed Original file line number Diff line number Diff line change 11
11
# except according to those terms.
12
12
13
13
# This script uses the following Unicode tables:
14
- # - DerivedCoreProperties.txt
15
- # - auxiliary/GraphemeBreakProperty.txt
16
- # - auxiliary/WordBreakProperty.txt
17
- # - ReadMe.txt
18
- # - UnicodeData.txt
14
+ # - PropertyValueAliases.txt
15
+ # - ScriptExtensions.txt
16
+ # - Scripts.txt
19
17
#
20
18
# Since this should not require frequent updates, we just store this
21
19
# out-of-line and check the unicode.rs file into git.
39
37
use super::ScriptExtension;
40
38
'''
41
39
42
- UNICODE_VERSION = (12 , 0 , 0 )
40
+ UNICODE_VERSION = (13 , 0 , 0 )
43
41
44
42
UNICODE_VERSION_NUMBER = "%s.%s.%s" % UNICODE_VERSION
45
43
Original file line number Diff line number Diff line change @@ -193,6 +193,15 @@ impl ScriptExtension {
193
193
( self . first == 0 ) & ( self . second == 0 ) & ( self . third == 0 )
194
194
}
195
195
196
+ /// Returns the number of scripts in the script extension
197
+ pub fn len ( self ) -> usize {
198
+ if self . is_common_or_inherited ( ) {
199
+ 1
200
+ } else {
201
+ ( self . first . count_ones ( ) + self . second . count_ones ( ) + self . third . count_ones ( ) ) as usize
202
+ }
203
+ }
204
+
196
205
/// Intersect this `ScriptExtension` with another `ScriptExtension`. Produces `Unknown` if things
197
206
/// do not intersect. This is equivalent to [`ScriptExtension::intersection`] but it stores the result
198
207
/// in `self`
@@ -257,9 +266,9 @@ impl ScriptExtension {
257
266
ext
258
267
}
259
268
260
- /// Iterate over the scripts in this string
269
+ /// Iterate over the scripts in this script extension
261
270
///
262
- /// Will never yeild Script::Unknown
271
+ /// Will never yield Script::Unknown
263
272
pub fn iter ( self ) -> ScriptIterator {
264
273
ScriptIterator { ext : self }
265
274
}
You can’t perform that action at this time.
0 commit comments