File tree Expand file tree Collapse file tree 3 files changed +1040
-968
lines changed
Expand file tree Collapse file tree 3 files changed +1040
-968
lines changed Original file line number Diff line number Diff line change 1111# except according to those terms.
1212
1313# 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
1917#
2018# Since this should not require frequent updates, we just store this
2119# out-of-line and check the unicode.rs file into git.
3937use super::ScriptExtension;
4038'''
4139
42- UNICODE_VERSION = (12 , 0 , 0 )
40+ UNICODE_VERSION = (13 , 0 , 0 )
4341
4442UNICODE_VERSION_NUMBER = "%s.%s.%s" % UNICODE_VERSION
4543
Original file line number Diff line number Diff line change @@ -193,6 +193,15 @@ impl ScriptExtension {
193193 ( self . first == 0 ) & ( self . second == 0 ) & ( self . third == 0 )
194194 }
195195
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+
196205 /// Intersect this `ScriptExtension` with another `ScriptExtension`. Produces `Unknown` if things
197206 /// do not intersect. This is equivalent to [`ScriptExtension::intersection`] but it stores the result
198207 /// in `self`
@@ -257,9 +266,9 @@ impl ScriptExtension {
257266 ext
258267 }
259268
260- /// Iterate over the scripts in this string
269+ /// Iterate over the scripts in this script extension
261270 ///
262- /// Will never yeild Script::Unknown
271+ /// Will never yield Script::Unknown
263272 pub fn iter ( self ) -> ScriptIterator {
264273 ScriptIterator { ext : self }
265274 }
You can’t perform that action at this time.
0 commit comments