• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zbraniecki / icu4x / 12020603084

23 Nov 2024 08:43PM UTC coverage: 75.71% (+0.2%) from 75.477%
12020603084

push

github

sffc
Touch Cargo.lock

55589 of 73424 relevant lines covered (75.71%)

644270.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.29
/components/properties/src/runtime.rs
1
// This file is part of ICU4X. For terms of use, please see the file
2
// called LICENSE at the top level of the ICU4X source tree
3
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4

5
//! 🚧 \[Experimental\] This module is experimental and currently crate-private. Let us know if you
6
//! have a use case for this!
7
//!
8
//! This module contains utilities for working with properties where the specific property in use
9
//! is not known at compile time.
10
//!
11
//! For regex engines, [`crate::sets::load_for_ecma262_unstable()`] is a convenient API for working
12
//! with properties at runtime tailored for the use case of ECMA262-compatible regex engines.
13

14
use crate::provider::*;
15
use crate::CodePointSetData;
16
#[cfg(doc)]
17
use crate::{
18
    props::{GeneralCategory, GeneralCategoryGroup, Script},
19
    script, CodePointMapData, PropertyParser,
20
};
21
use icu_provider::prelude::*;
22

23
/// This type can represent any binary Unicode property.
24
///
25
/// This is intended to be used in situations where the exact unicode property needed is
26
/// only known at runtime, for example in regex engines.
27
///
28
/// The values are intended to be identical to ICU4C's UProperty enum
29
#[non_exhaustive]
30
#[allow(missing_docs)]
31
#[allow(dead_code)]
32
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
×
33
enum BinaryProperty {
34
    Alnum = 44,
35
    Alphabetic = 0,
36
    AsciiHexDigit = 1,
37
    BidiControl = 2,
38
    BidiMirrored = 3,
39
    Blank = 45,
40
    Cased = 49,
41
    CaseIgnorable = 50,
42
    CaseSensitive = 34,
43
    ChangesWhenCasefolded = 54,
44
    ChangesWhenCasemapped = 55,
45
    ChangesWhenLowercased = 51,
46
    ChangesWhenNfkcCasefolded = 56,
47
    ChangesWhenTitlecased = 53,
48
    ChangesWhenUppercased = 52,
49
    Dash = 4,
50
    DefaultIgnorableCodePoint = 5,
51
    Deprecated = 6,
52
    Diacritic = 7,
53
    Emoji = 57,
54
    EmojiComponent = 61,
55
    EmojiModifier = 59,
56
    EmojiModifierBase = 60,
57
    EmojiPresentation = 58,
58
    ExtendedPictographic = 64,
59
    Extender = 8,
60
    FullCompositionExclusion = 9,
61
    Graph = 46,
62
    GraphemeBase = 10,
63
    GraphemeExtend = 11,
64
    GraphemeLink = 12,
65
    HexDigit = 13,
66
    Hyphen = 14,
67
    IdContinue = 15,
68
    Ideographic = 17,
69
    IdsBinaryOperator = 18,
70
    IdStart = 16,
71
    IdsTrinaryOperator = 19,
72
    JoinControl = 20,
73
    LogicalOrderException = 21,
74
    Lowercase = 22,
75
    Math = 23,
76
    NfcInert = 39,
77
    NfdInert = 37,
78
    NfkcInert = 40,
79
    NfkdInert = 38,
80
    NoncharacterCodePoint = 24,
81
    PatternSyntax = 42,
82
    PatternWhiteSpace = 43,
83
    PrependedConcatenationMark = 63,
84
    Print = 47,
85
    QuotationMark = 25,
86
    Radical = 26,
87
    RegionalIndicator = 62,
88
    SegmentStarter = 41,
89
    SentenceTerminal = 35,
90
    SoftDotted = 27,
91
    TerminalPunctuation = 28,
92
    UnifiedIdeograph = 29,
93
    Uppercase = 30,
94
    VariationSelector = 36,
95
    WhiteSpace = 31,
96
    Xdigit = 48,
97
    XidContinue = 32,
98
    XidStart = 33,
99
}
100

101
/// This type can represent any binary property over strings.
102
///
103
/// This is intended to be used in situations where the exact unicode property needed is
104
/// only known at runtime, for example in regex engines.
105
///
106
/// The values are intended to be identical to ICU4C's UProperty enum
107
#[non_exhaustive]
108
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
×
109
#[allow(dead_code)]
110
#[allow(missing_docs)]
111
enum StringBinaryProperty {
112
    BasicEmoji = 65,
113
    EmojiKeycapSequence = 66,
114
    RgiEmoji = 71,
115
    RgiEmojiFlagSequence = 68,
116
    RgiEmojiModifierSequence = 67,
117
    RgiEmojiTagSequence = 69,
118
    RgiEmojiZWJSequence = 70,
119
}
120

121
/// This type can represent any enumerated Unicode property.
122
///
123
/// This is intended to be used in situations where the exact unicode property needed is
124
/// only known at runtime, for example in regex engines.
125
///
126
/// The values are intended to be identical to ICU4C's UProperty enum
127
#[non_exhaustive]
128
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
×
129
#[allow(dead_code)]
130
#[allow(missing_docs)]
131
enum EnumeratedProperty {
132
    BidiClass = 0x1000,
133
    BidiPairedBracketType = 0x1015,
134
    Block = 0x1001,
135
    CombiningClass = 0x1002,
136
    DecompositionType = 0x1003,
137
    EastAsianWidth = 0x1004,
138
    GeneralCategory = 0x1005,
139
    GraphemeClusterBreak = 0x1012,
140
    HangulSyllableType = 0x100B,
141
    IndicPositionalCategory = 0x1016,
142
    IndicSyllabicCategory = 0x1017,
143
    JoiningGroup = 0x1006,
144
    JoiningType = 0x1007,
145
    LeadCanonicalCombiningClass = 0x1010,
146
    LineBreak = 0x1008,
147
    NFCQuickCheck = 0x100E,
148
    NFDQuickCheck = 0x100C,
149
    NFKCQuickCheck = 0x100F,
150
    NFKDQuickCheck = 0x100D,
151
    NumericType = 0x1009,
152
    Script = 0x100A,
153
    SentenceBreak = 0x1013,
154
    TrailCanonicalCombiningClass = 0x1011,
155
    VerticalOrientation = 0x1018,
156
    WordBreak = 0x1014,
157
}
158

159
/// This type can represent any Unicode mask property.
160
///
161
/// This is intended to be used in situations where the exact unicode property needed is
162
/// only known at runtime, for example in regex engines.
163
///
164
/// The values are intended to be identical to ICU4C's UProperty enum
165
#[non_exhaustive]
166
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
×
167
#[allow(dead_code)]
168
#[allow(missing_docs)]
169
enum MaskProperty {
170
    GeneralCategoryMask = 0x2000,
171
}
172

173
/// This type can represent any numeric Unicode property.
174
///
175
/// This is intended to be used in situations where the exact unicode property needed is
176
/// only known at runtime, for example in regex engines.
177
///
178
/// The values are intended to be identical to ICU4C's UProperty enum
179
#[non_exhaustive]
180
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
×
181
#[allow(dead_code)]
182
#[allow(missing_docs)]
183
enum NumericProperty {
184
    NumericValue = 0x3000,
185
}
186

187
/// This type can represent any Unicode string property.
188
///
189
/// This is intended to be used in situations where the exact unicode property needed is
190
/// only known at runtime, for example in regex engines.
191
///
192
/// The values are intended to be identical to ICU4C's UProperty enum
193
#[non_exhaustive]
194
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
×
195
#[allow(dead_code)]
196
#[allow(missing_docs)]
197
enum StringProperty {
198
    Age = 0x4000,
199
    BidiMirroringGlyph = 0x4001,
200
    BidiPairedBracket = 0x400D,
201
    CaseFolding = 0x4002,
202
    ISOComment = 0x4003,
203
    LowercaseMapping = 0x4004,
204
    Name = 0x4005,
205
    SimpleCaseFolding = 0x4006,
206
    SimpleLowercaseMapping = 0x4007,
207
    SimpleTitlecaseMapping = 0x4008,
208
    SimpleUppercaseMapping = 0x4009,
209
    TitlecaseMapping = 0x400A,
210
    Unicode1Name = 0x400B,
211
    UppercaseMapping = 0x400C,
212
}
213

214
#[non_exhaustive]
215
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
×
216
#[allow(dead_code)]
217
#[allow(missing_docs)]
218
enum MiscProperty {
219
    ScriptExtensions = 0x7000,
220
}
221

222
impl CodePointSetData {
223
    /// Returns a type capable of looking up values for a property specified as a string, as long as it is a
224
    /// [binary property listed in ECMA-262][ecma], using strict matching on the names in the spec.
225
    ///
226
    /// This handles every property required by ECMA-262 `/u` regular expressions, except for:
227
    ///
228
    /// - `Script` and `General_Category`: handle these directly using property values parsed via
229
    ///   [`PropertyParser<GeneralCategory>`] and [`PropertyParser<Script>`]
230
    ///    if necessary.
231
    /// - `Script_Extensions`: handle this directly using APIs from [`crate::script::ScriptWithExtensions`]
232
    /// - `General_Category` mask values: Handle this alongside `General_Category` using [`GeneralCategoryGroup`],
233
    ///    using property values parsed via [`PropertyParser<GeneralCategory>`] if necessary
234
    /// - `Assigned`, `All`, and `ASCII` pseudoproperties: Handle these using their equivalent sets:
235
    ///    - `Any` can be expressed as the range `[\u{0}-\u{10FFFF}]`
236
    ///    - `Assigned` can be expressed as the inverse of the set `gc=Cn` (i.e., `\P{gc=Cn}`).
237
    ///    - `ASCII` can be expressed as the range `[\u{0}-\u{7F}]`
238
    /// - `General_Category` property values can themselves be treated like properties using a shorthand in ECMA262,
239
    ///    simply create the corresponding `GeneralCategory` set.
240
    ///
241
    /// ✨ *Enabled with the `compiled_data` Cargo feature.*
242
    ///
243
    /// [📚 Help choosing a constructor](icu_provider::constructors)
244
    ///
245
    /// ```
246
    /// use icu::properties::CodePointSetData;
247
    ///
248
    /// let emoji = CodePointSetData::new_for_ecma262(b"Emoji")
249
    ///     .expect("is an ECMA-262 property");
250
    ///
251
    /// assert!(emoji.contains('🔥')); // U+1F525 FIRE
252
    /// assert!(!emoji.contains('V'));
253
    /// ```
254
    ///
255
    /// [ecma]: https://tc39.es/ecma262/#table-binary-unicode-properties
256
    #[cfg(feature = "compiled_data")]
257
    pub fn new_for_ecma262(prop: &[u8]) -> Option<crate::CodePointSetDataBorrowed<'static>> {
1✔
258
        use crate::props::*;
259
        Some(match prop {
2✔
260
            AsciiHexDigit::NAME | AsciiHexDigit::SHORT_NAME => Self::new::<AsciiHexDigit>(),
1✔
261
            Alphabetic::NAME | Alphabetic::SHORT_NAME => Self::new::<Alphabetic>(),
1✔
262
            BidiControl::NAME | BidiControl::SHORT_NAME => Self::new::<BidiControl>(),
×
263
            BidiMirrored::NAME | BidiMirrored::SHORT_NAME => Self::new::<BidiMirrored>(),
×
264
            CaseIgnorable::NAME | CaseIgnorable::SHORT_NAME => Self::new::<CaseIgnorable>(),
×
265
            #[allow(unreachable_patterns)] // no short name
266
            Cased::NAME | Cased::SHORT_NAME => Self::new::<Cased>(),
×
267
            ChangesWhenCasefolded::NAME | ChangesWhenCasefolded::SHORT_NAME => {
×
268
                Self::new::<ChangesWhenCasefolded>()
×
269
            }
270
            ChangesWhenCasemapped::NAME | ChangesWhenCasemapped::SHORT_NAME => {
271
                Self::new::<ChangesWhenCasemapped>()
×
272
            }
273
            ChangesWhenLowercased::NAME | ChangesWhenLowercased::SHORT_NAME => {
×
274
                Self::new::<ChangesWhenLowercased>()
×
275
            }
276
            ChangesWhenNfkcCasefolded::NAME | ChangesWhenNfkcCasefolded::SHORT_NAME => {
×
277
                Self::new::<ChangesWhenNfkcCasefolded>()
×
278
            }
279
            ChangesWhenTitlecased::NAME | ChangesWhenTitlecased::SHORT_NAME => {
280
                Self::new::<ChangesWhenTitlecased>()
×
281
            }
282
            ChangesWhenUppercased::NAME | ChangesWhenUppercased::SHORT_NAME => {
283
                Self::new::<ChangesWhenUppercased>()
×
284
            }
285
            #[allow(unreachable_patterns)] // no short name
286
            Dash::NAME | Dash::SHORT_NAME => Self::new::<Dash>(),
×
287
            DefaultIgnorableCodePoint::NAME | DefaultIgnorableCodePoint::SHORT_NAME => {
288
                Self::new::<DefaultIgnorableCodePoint>()
×
289
            }
290
            Deprecated::NAME | Deprecated::SHORT_NAME => Self::new::<Deprecated>(),
×
291
            Diacritic::NAME | Diacritic::SHORT_NAME => Self::new::<Diacritic>(),
×
292
            #[allow(unreachable_patterns)] // no short name
293
            Emoji::NAME | Emoji::SHORT_NAME => Self::new::<Emoji>(),
1✔
294
            EmojiComponent::NAME | EmojiComponent::SHORT_NAME => Self::new::<EmojiComponent>(),
×
295
            EmojiModifier::NAME | EmojiModifier::SHORT_NAME => Self::new::<EmojiModifier>(),
×
296
            EmojiModifierBase::NAME | EmojiModifierBase::SHORT_NAME => {
×
297
                Self::new::<EmojiModifierBase>()
×
298
            }
299
            EmojiPresentation::NAME | EmojiPresentation::SHORT_NAME => {
×
300
                Self::new::<EmojiPresentation>()
×
301
            }
302
            ExtendedPictographic::NAME | ExtendedPictographic::SHORT_NAME => {
×
303
                Self::new::<ExtendedPictographic>()
×
304
            }
305
            Extender::NAME | Extender::SHORT_NAME => Self::new::<Extender>(),
×
306
            GraphemeBase::NAME | GraphemeBase::SHORT_NAME => Self::new::<GraphemeBase>(),
×
307
            GraphemeExtend::NAME | GraphemeExtend::SHORT_NAME => Self::new::<GraphemeExtend>(),
×
308
            HexDigit::NAME | HexDigit::SHORT_NAME => Self::new::<HexDigit>(),
×
309
            IdsBinaryOperator::NAME | IdsBinaryOperator::SHORT_NAME => {
310
                Self::new::<IdsBinaryOperator>()
×
311
            }
312
            IdsTrinaryOperator::NAME | IdsTrinaryOperator::SHORT_NAME => {
×
313
                Self::new::<IdsTrinaryOperator>()
×
314
            }
315
            IdContinue::NAME | IdContinue::SHORT_NAME => Self::new::<IdContinue>(),
×
316
            IdStart::NAME | IdStart::SHORT_NAME => Self::new::<IdStart>(),
×
317
            Ideographic::NAME | Ideographic::SHORT_NAME => Self::new::<Ideographic>(),
×
318
            JoinControl::NAME | JoinControl::SHORT_NAME => Self::new::<JoinControl>(),
×
319
            LogicalOrderException::NAME | LogicalOrderException::SHORT_NAME => {
320
                Self::new::<LogicalOrderException>()
×
321
            }
322
            Lowercase::NAME | Lowercase::SHORT_NAME => Self::new::<Lowercase>(),
×
323
            #[allow(unreachable_patterns)] // no short name
324
            Math::NAME | Math::SHORT_NAME => Self::new::<Math>(),
×
325
            NoncharacterCodePoint::NAME | NoncharacterCodePoint::SHORT_NAME => {
326
                Self::new::<NoncharacterCodePoint>()
×
327
            }
328
            PatternSyntax::NAME | PatternSyntax::SHORT_NAME => Self::new::<PatternSyntax>(),
×
329
            PatternWhiteSpace::NAME | PatternWhiteSpace::SHORT_NAME => {
330
                Self::new::<PatternWhiteSpace>()
×
331
            }
332
            QuotationMark::NAME | QuotationMark::SHORT_NAME => Self::new::<QuotationMark>(),
×
333
            #[allow(unreachable_patterns)] // no short name
334
            Radical::NAME | Radical::SHORT_NAME => Self::new::<Radical>(),
×
335
            RegionalIndicator::NAME | RegionalIndicator::SHORT_NAME => {
336
                Self::new::<RegionalIndicator>()
×
337
            }
338
            SentenceTerminal::NAME | SentenceTerminal::SHORT_NAME => {
×
339
                Self::new::<SentenceTerminal>()
×
340
            }
341
            SoftDotted::NAME | SoftDotted::SHORT_NAME => Self::new::<SoftDotted>(),
×
342
            TerminalPunctuation::NAME | TerminalPunctuation::SHORT_NAME => {
343
                Self::new::<TerminalPunctuation>()
×
344
            }
345
            UnifiedIdeograph::NAME | UnifiedIdeograph::SHORT_NAME => {
346
                Self::new::<UnifiedIdeograph>()
×
347
            }
348
            Uppercase::NAME | Uppercase::SHORT_NAME => Self::new::<Uppercase>(),
×
349
            VariationSelector::NAME | VariationSelector::SHORT_NAME => {
350
                Self::new::<VariationSelector>()
×
351
            }
352
            WhiteSpace::NAME | WhiteSpace::SHORT_NAME => Self::new::<WhiteSpace>(),
×
353
            XidContinue::NAME | XidContinue::SHORT_NAME => Self::new::<XidContinue>(),
×
354
            XidStart::NAME | XidStart::SHORT_NAME => Self::new::<XidStart>(),
×
355
            // Not an ECMA-262 property
356
            _ => return None,
×
357
        })
358
    }
1✔
359

360
    icu_provider::gen_any_buffer_data_constructors!(
361
        (prop: &[u8]) -> result: Option<Result<Self, DataError>>,
362
        functions: [
363
            new_for_ecma262: skip,
364
            try_new_for_ecma262_with_buffer_provider,
365
            try_new_for_ecma262_with_any_provider,
366
            try_new_for_ecma262_unstable,
367
            Self,
368
        ]
369
    );
370

371
    #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::new_for_ecma262)]
372
    pub fn try_new_for_ecma262_unstable<P>(
23✔
373
        provider: &P,
374
        prop: &[u8],
375
    ) -> Option<Result<Self, DataError>>
376
    where
377
        P: ?Sized
378
            + DataProvider<AsciiHexDigitV1Marker>
379
            + DataProvider<AlphabeticV1Marker>
380
            + DataProvider<BidiControlV1Marker>
381
            + DataProvider<BidiMirroredV1Marker>
382
            + DataProvider<CaseIgnorableV1Marker>
383
            + DataProvider<CasedV1Marker>
384
            + DataProvider<ChangesWhenCasefoldedV1Marker>
385
            + DataProvider<ChangesWhenCasemappedV1Marker>
386
            + DataProvider<ChangesWhenLowercasedV1Marker>
387
            + DataProvider<ChangesWhenNfkcCasefoldedV1Marker>
388
            + DataProvider<ChangesWhenTitlecasedV1Marker>
389
            + DataProvider<ChangesWhenUppercasedV1Marker>
390
            + DataProvider<DashV1Marker>
391
            + DataProvider<DefaultIgnorableCodePointV1Marker>
392
            + DataProvider<DeprecatedV1Marker>
393
            + DataProvider<DiacriticV1Marker>
394
            + DataProvider<EmojiV1Marker>
395
            + DataProvider<EmojiComponentV1Marker>
396
            + DataProvider<EmojiModifierV1Marker>
397
            + DataProvider<EmojiModifierBaseV1Marker>
398
            + DataProvider<EmojiPresentationV1Marker>
399
            + DataProvider<ExtendedPictographicV1Marker>
400
            + DataProvider<ExtenderV1Marker>
401
            + DataProvider<GraphemeBaseV1Marker>
402
            + DataProvider<GraphemeExtendV1Marker>
403
            + DataProvider<HexDigitV1Marker>
404
            + DataProvider<IdsBinaryOperatorV1Marker>
405
            + DataProvider<IdsTrinaryOperatorV1Marker>
406
            + DataProvider<IdContinueV1Marker>
407
            + DataProvider<IdStartV1Marker>
408
            + DataProvider<IdeographicV1Marker>
409
            + DataProvider<JoinControlV1Marker>
410
            + DataProvider<LogicalOrderExceptionV1Marker>
411
            + DataProvider<LowercaseV1Marker>
412
            + DataProvider<MathV1Marker>
413
            + DataProvider<NoncharacterCodePointV1Marker>
414
            + DataProvider<PatternSyntaxV1Marker>
415
            + DataProvider<PatternWhiteSpaceV1Marker>
416
            + DataProvider<QuotationMarkV1Marker>
417
            + DataProvider<RadicalV1Marker>
418
            + DataProvider<RegionalIndicatorV1Marker>
419
            + DataProvider<SentenceTerminalV1Marker>
420
            + DataProvider<SoftDottedV1Marker>
421
            + DataProvider<TerminalPunctuationV1Marker>
422
            + DataProvider<UnifiedIdeographV1Marker>
423
            + DataProvider<UppercaseV1Marker>
424
            + DataProvider<VariationSelectorV1Marker>
425
            + DataProvider<WhiteSpaceV1Marker>
426
            + DataProvider<XidContinueV1Marker>
427
            + DataProvider<XidStartV1Marker>,
428
    {
429
        use crate::props::*;
430
        Some(match prop {
43✔
431
            AsciiHexDigit::NAME | AsciiHexDigit::SHORT_NAME => {
23✔
432
                Self::try_new_unstable::<AsciiHexDigit>(provider)
15✔
433
            }
434
            Alphabetic::NAME | Alphabetic::SHORT_NAME => {
8✔
435
                Self::try_new_unstable::<Alphabetic>(provider)
×
436
            }
437
            BidiControl::NAME | BidiControl::SHORT_NAME => {
8✔
438
                Self::try_new_unstable::<BidiControl>(provider)
×
439
            }
440
            BidiMirrored::NAME | BidiMirrored::SHORT_NAME => {
8✔
441
                Self::try_new_unstable::<BidiMirrored>(provider)
×
442
            }
443
            CaseIgnorable::NAME | CaseIgnorable::SHORT_NAME => {
8✔
444
                Self::try_new_unstable::<CaseIgnorable>(provider)
×
445
            }
446
            #[allow(unreachable_patterns)] // no short name
447
            Cased::NAME | Cased::SHORT_NAME => Self::try_new_unstable::<Cased>(provider),
×
448
            ChangesWhenCasefolded::NAME | ChangesWhenCasefolded::SHORT_NAME => {
7✔
449
                Self::try_new_unstable::<ChangesWhenCasefolded>(provider)
×
450
            }
451
            ChangesWhenCasemapped::NAME | ChangesWhenCasemapped::SHORT_NAME => {
452
                Self::try_new_unstable::<ChangesWhenCasemapped>(provider)
×
453
            }
454
            ChangesWhenLowercased::NAME | ChangesWhenLowercased::SHORT_NAME => {
7✔
455
                Self::try_new_unstable::<ChangesWhenLowercased>(provider)
×
456
            }
457
            ChangesWhenNfkcCasefolded::NAME | ChangesWhenNfkcCasefolded::SHORT_NAME => {
7✔
458
                Self::try_new_unstable::<ChangesWhenNfkcCasefolded>(provider)
×
459
            }
460
            ChangesWhenTitlecased::NAME | ChangesWhenTitlecased::SHORT_NAME => {
461
                Self::try_new_unstable::<ChangesWhenTitlecased>(provider)
×
462
            }
463
            ChangesWhenUppercased::NAME | ChangesWhenUppercased::SHORT_NAME => {
464
                Self::try_new_unstable::<ChangesWhenUppercased>(provider)
×
465
            }
466
            #[allow(unreachable_patterns)] // no short name
467
            Dash::NAME | Dash::SHORT_NAME => Self::try_new_unstable::<Dash>(provider),
×
468
            DefaultIgnorableCodePoint::NAME | DefaultIgnorableCodePoint::SHORT_NAME => {
469
                Self::try_new_unstable::<DefaultIgnorableCodePoint>(provider)
×
470
            }
471
            Deprecated::NAME | Deprecated::SHORT_NAME => {
472
                Self::try_new_unstable::<Deprecated>(provider)
×
473
            }
474
            Diacritic::NAME | Diacritic::SHORT_NAME => {
7✔
475
                Self::try_new_unstable::<Diacritic>(provider)
×
476
            }
477
            #[allow(unreachable_patterns)] // no short name
478
            Emoji::NAME | Emoji::SHORT_NAME => Self::try_new_unstable::<Emoji>(provider),
×
479
            EmojiComponent::NAME | EmojiComponent::SHORT_NAME => {
480
                Self::try_new_unstable::<EmojiComponent>(provider)
×
481
            }
482
            EmojiModifier::NAME | EmojiModifier::SHORT_NAME => {
483
                Self::try_new_unstable::<EmojiModifier>(provider)
×
484
            }
485
            EmojiModifierBase::NAME | EmojiModifierBase::SHORT_NAME => {
1✔
486
                Self::try_new_unstable::<EmojiModifierBase>(provider)
×
487
            }
488
            EmojiPresentation::NAME | EmojiPresentation::SHORT_NAME => {
1✔
489
                Self::try_new_unstable::<EmojiPresentation>(provider)
×
490
            }
491
            ExtendedPictographic::NAME | ExtendedPictographic::SHORT_NAME => {
1✔
492
                Self::try_new_unstable::<ExtendedPictographic>(provider)
×
493
            }
494
            Extender::NAME | Extender::SHORT_NAME => Self::try_new_unstable::<Extender>(provider),
1✔
495
            GraphemeBase::NAME | GraphemeBase::SHORT_NAME => {
496
                Self::try_new_unstable::<GraphemeBase>(provider)
×
497
            }
498
            GraphemeExtend::NAME | GraphemeExtend::SHORT_NAME => {
499
                Self::try_new_unstable::<GraphemeExtend>(provider)
×
500
            }
501
            HexDigit::NAME | HexDigit::SHORT_NAME => Self::try_new_unstable::<HexDigit>(provider),
×
502
            IdsBinaryOperator::NAME | IdsBinaryOperator::SHORT_NAME => {
503
                Self::try_new_unstable::<IdsBinaryOperator>(provider)
×
504
            }
505
            IdsTrinaryOperator::NAME | IdsTrinaryOperator::SHORT_NAME => {
1✔
506
                Self::try_new_unstable::<IdsTrinaryOperator>(provider)
×
507
            }
508
            IdContinue::NAME | IdContinue::SHORT_NAME => {
1✔
509
                Self::try_new_unstable::<IdContinue>(provider)
×
510
            }
511
            IdStart::NAME | IdStart::SHORT_NAME => Self::try_new_unstable::<IdStart>(provider),
×
512
            Ideographic::NAME | Ideographic::SHORT_NAME => {
513
                Self::try_new_unstable::<Ideographic>(provider)
×
514
            }
515
            JoinControl::NAME | JoinControl::SHORT_NAME => {
516
                Self::try_new_unstable::<JoinControl>(provider)
×
517
            }
518
            LogicalOrderException::NAME | LogicalOrderException::SHORT_NAME => {
519
                Self::try_new_unstable::<LogicalOrderException>(provider)
×
520
            }
521
            Lowercase::NAME | Lowercase::SHORT_NAME => {
522
                Self::try_new_unstable::<Lowercase>(provider)
6✔
523
            }
524
            #[allow(unreachable_patterns)] // no short name
525
            Math::NAME | Math::SHORT_NAME => Self::try_new_unstable::<Math>(provider),
×
526
            NoncharacterCodePoint::NAME | NoncharacterCodePoint::SHORT_NAME => {
527
                Self::try_new_unstable::<NoncharacterCodePoint>(provider)
×
528
            }
529
            PatternSyntax::NAME | PatternSyntax::SHORT_NAME => {
530
                Self::try_new_unstable::<PatternSyntax>(provider)
×
531
            }
532
            PatternWhiteSpace::NAME | PatternWhiteSpace::SHORT_NAME => {
533
                Self::try_new_unstable::<PatternWhiteSpace>(provider)
×
534
            }
535
            QuotationMark::NAME | QuotationMark::SHORT_NAME => {
536
                Self::try_new_unstable::<QuotationMark>(provider)
×
537
            }
538
            #[allow(unreachable_patterns)] // no short name
539
            Radical::NAME | Radical::SHORT_NAME => Self::try_new_unstable::<Radical>(provider),
×
540
            RegionalIndicator::NAME | RegionalIndicator::SHORT_NAME => {
541
                Self::try_new_unstable::<RegionalIndicator>(provider)
×
542
            }
543
            SentenceTerminal::NAME | SentenceTerminal::SHORT_NAME => {
1✔
544
                Self::try_new_unstable::<SentenceTerminal>(provider)
×
545
            }
546
            SoftDotted::NAME | SoftDotted::SHORT_NAME => {
547
                Self::try_new_unstable::<SoftDotted>(provider)
×
548
            }
549
            TerminalPunctuation::NAME | TerminalPunctuation::SHORT_NAME => {
550
                Self::try_new_unstable::<TerminalPunctuation>(provider)
×
551
            }
552
            UnifiedIdeograph::NAME | UnifiedIdeograph::SHORT_NAME => {
553
                Self::try_new_unstable::<UnifiedIdeograph>(provider)
×
554
            }
555
            Uppercase::NAME | Uppercase::SHORT_NAME => {
556
                Self::try_new_unstable::<Uppercase>(provider)
×
557
            }
558
            VariationSelector::NAME | VariationSelector::SHORT_NAME => {
559
                Self::try_new_unstable::<VariationSelector>(provider)
×
560
            }
561
            WhiteSpace::NAME | WhiteSpace::SHORT_NAME => {
562
                Self::try_new_unstable::<WhiteSpace>(provider)
×
563
            }
564
            XidContinue::NAME | XidContinue::SHORT_NAME => {
565
                Self::try_new_unstable::<XidContinue>(provider)
×
566
            }
567
            XidStart::NAME | XidStart::SHORT_NAME => Self::try_new_unstable::<XidStart>(provider),
×
568
            // Not an ECMA-262 property
569
            _ => return None,
2✔
570
        })
571
    }
23✔
572
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc