File tree Expand file tree Collapse file tree 4 files changed +5
-16
lines changed
src/tools/unicode-table-generator/src Expand file tree Collapse file tree 4 files changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -950,7 +950,11 @@ impl char {
950
950
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
951
951
#[ inline]
952
952
pub fn is_control ( self ) -> bool {
953
- if self . is_ascii ( ) { self . is_ascii_control ( ) } else { unicode:: Cc ( self ) }
953
+ // According to
954
+ // https://www.unicode.org/policies/stability_policy.html#Property_Value,
955
+ // the set of codepoints in `Cc` will never change. So we can hard-code
956
+ // the patterns to match against instead of using a table.
957
+ matches ! ( self , '\0' ..='\x1f' | '\x7f' ..='\u{9f}' )
954
958
}
955
959
956
960
/// Returns `true` if this `char` has the `Grapheme_Extend` property.
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ pub use unicode_data::conversions;
8
8
#[ rustfmt:: skip]
9
9
pub ( crate ) use unicode_data:: alphabetic:: lookup as Alphabetic ;
10
10
pub ( crate ) use unicode_data:: case_ignorable:: lookup as Case_Ignorable ;
11
- pub ( crate ) use unicode_data:: cc:: lookup as Cc ;
12
11
pub ( crate ) use unicode_data:: grapheme_extend:: lookup as Grapheme_Extend ;
13
12
pub ( crate ) use unicode_data:: lowercase:: lookup as Lowercase ;
14
13
pub ( crate ) use unicode_data:: lt:: lookup as Lt ;
Original file line number Diff line number Diff line change 1
1
///! This file is generated by `./x run src/tools/unicode-table-generator`; do not edit manually!
2
2
// Alphabetic : 1723 bytes, 142707 codepoints in 755 ranges (U+0000AA - U+0323B0) using skiplist
3
3
// Case_Ignorable : 1043 bytes, 2744 codepoints in 447 ranges (U+0000A8 - U+0E01F0) using skiplist
4
- // Cc : 0 bytes, 32 codepoints in 1 ranges (U+000080 - U+0000A0) using match
5
4
// Grapheme_Extend : 887 bytes, 2193 codepoints in 375 ranges (U+000300 - U+0E01F0) using skiplist
6
5
// Lowercase : 933 bytes, 2543 codepoints in 674 ranges (U+0000AA - U+01E944) using bitset
7
6
// Lt : 0 bytes, 31 codepoints in 10 ranges (U+0001C5 - U+001FFD) using match
@@ -338,18 +337,6 @@ pub mod case_ignorable {
338
337
}
339
338
}
340
339
341
- #[ rustfmt:: skip]
342
- pub mod cc {
343
- #[ inline]
344
- pub const fn lookup ( c : char ) -> bool {
345
- debug_assert ! ( !c. is_ascii( ) ) ;
346
- match c as u32 {
347
- 0x80 ..=0x9f => true ,
348
- _ => false ,
349
- }
350
- }
351
- }
352
-
353
340
#[ rustfmt:: skip]
354
341
pub mod grapheme_extend {
355
342
use super :: ShortOffsetRunHeader ;
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ static PROPERTIES: &[&str] = &[
94
94
"Case_Ignorable" ,
95
95
"Grapheme_Extend" ,
96
96
"White_Space" ,
97
- "Cc" ,
98
97
"N" ,
99
98
] ;
100
99
You can’t perform that action at this time.
0 commit comments