icu_properties/
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
14use crate::provider::*;
15use crate::CodePointSetData;
16#[cfg(doc)]
17use crate::{
18    props::{GeneralCategory, GeneralCategoryGroup, Script},
19    script, CodePointMapData, PropertyParser,
20};
21use 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(#[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::marker::Copy for BinaryProperty { }Copy, #[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::clone::Clone for BinaryProperty {
    #[inline]
    fn clone(&self) -> BinaryProperty { *self }
}Clone, #[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::cmp::PartialEq for BinaryProperty {
    #[inline]
    fn eq(&self, other: &BinaryProperty) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::cmp::Eq for BinaryProperty {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::cmp::PartialOrd for BinaryProperty {
    #[inline]
    fn partial_cmp(&self, other: &BinaryProperty)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::cmp::Ord for BinaryProperty {
    #[inline]
    fn cmp(&self, other: &BinaryProperty) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::hash::Hash for BinaryProperty {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[automatically_derived]
#[allow(missing_docs)]
#[allow(dead_code)]
impl ::core::fmt::Debug for BinaryProperty {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                BinaryProperty::Alnum => "Alnum",
                BinaryProperty::Alphabetic => "Alphabetic",
                BinaryProperty::AsciiHexDigit => "AsciiHexDigit",
                BinaryProperty::BidiControl => "BidiControl",
                BinaryProperty::BidiMirrored => "BidiMirrored",
                BinaryProperty::Blank => "Blank",
                BinaryProperty::Cased => "Cased",
                BinaryProperty::CaseIgnorable => "CaseIgnorable",
                BinaryProperty::CaseSensitive => "CaseSensitive",
                BinaryProperty::ChangesWhenCasefolded =>
                    "ChangesWhenCasefolded",
                BinaryProperty::ChangesWhenCasemapped =>
                    "ChangesWhenCasemapped",
                BinaryProperty::ChangesWhenLowercased =>
                    "ChangesWhenLowercased",
                BinaryProperty::ChangesWhenNfkcCasefolded =>
                    "ChangesWhenNfkcCasefolded",
                BinaryProperty::ChangesWhenTitlecased =>
                    "ChangesWhenTitlecased",
                BinaryProperty::ChangesWhenUppercased =>
                    "ChangesWhenUppercased",
                BinaryProperty::Dash => "Dash",
                BinaryProperty::DefaultIgnorableCodePoint =>
                    "DefaultIgnorableCodePoint",
                BinaryProperty::Deprecated => "Deprecated",
                BinaryProperty::Diacritic => "Diacritic",
                BinaryProperty::Emoji => "Emoji",
                BinaryProperty::EmojiComponent => "EmojiComponent",
                BinaryProperty::EmojiModifier => "EmojiModifier",
                BinaryProperty::EmojiModifierBase => "EmojiModifierBase",
                BinaryProperty::EmojiPresentation => "EmojiPresentation",
                BinaryProperty::ExtendedPictographic =>
                    "ExtendedPictographic",
                BinaryProperty::Extender => "Extender",
                BinaryProperty::FullCompositionExclusion =>
                    "FullCompositionExclusion",
                BinaryProperty::Graph => "Graph",
                BinaryProperty::GraphemeBase => "GraphemeBase",
                BinaryProperty::GraphemeExtend => "GraphemeExtend",
                BinaryProperty::GraphemeLink => "GraphemeLink",
                BinaryProperty::HexDigit => "HexDigit",
                BinaryProperty::Hyphen => "Hyphen",
                BinaryProperty::IdCompatMathContinue =>
                    "IdCompatMathContinue",
                BinaryProperty::IdCompatMathStart => "IdCompatMathStart",
                BinaryProperty::IdContinue => "IdContinue",
                BinaryProperty::Ideographic => "Ideographic",
                BinaryProperty::IdsBinaryOperator => "IdsBinaryOperator",
                BinaryProperty::IdStart => "IdStart",
                BinaryProperty::IdsTrinaryOperator => "IdsTrinaryOperator",
                BinaryProperty::IdsUnaryOperator => "IdsUnaryOperator",
                BinaryProperty::JoinControl => "JoinControl",
                BinaryProperty::LogicalOrderException =>
                    "LogicalOrderException",
                BinaryProperty::Lowercase => "Lowercase",
                BinaryProperty::Math => "Math",
                BinaryProperty::ModifierCombiningMark =>
                    "ModifierCombiningMark",
                BinaryProperty::NfcInert => "NfcInert",
                BinaryProperty::NfdInert => "NfdInert",
                BinaryProperty::NfkcInert => "NfkcInert",
                BinaryProperty::NfkdInert => "NfkdInert",
                BinaryProperty::NoncharacterCodePoint =>
                    "NoncharacterCodePoint",
                BinaryProperty::PatternSyntax => "PatternSyntax",
                BinaryProperty::PatternWhiteSpace => "PatternWhiteSpace",
                BinaryProperty::PrependedConcatenationMark =>
                    "PrependedConcatenationMark",
                BinaryProperty::Print => "Print",
                BinaryProperty::QuotationMark => "QuotationMark",
                BinaryProperty::Radical => "Radical",
                BinaryProperty::RegionalIndicator => "RegionalIndicator",
                BinaryProperty::SegmentStarter => "SegmentStarter",
                BinaryProperty::SentenceTerminal => "SentenceTerminal",
                BinaryProperty::SoftDotted => "SoftDotted",
                BinaryProperty::TerminalPunctuation => "TerminalPunctuation",
                BinaryProperty::UnifiedIdeograph => "UnifiedIdeograph",
                BinaryProperty::Uppercase => "Uppercase",
                BinaryProperty::VariationSelector => "VariationSelector",
                BinaryProperty::WhiteSpace => "WhiteSpace",
                BinaryProperty::Xdigit => "Xdigit",
                BinaryProperty::XidContinue => "XidContinue",
                BinaryProperty::XidStart => "XidStart",
            })
    }
}Debug)]
33enum 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    IdCompatMathContinue = 65,
68    IdCompatMathStart = 66,
69    IdContinue = 15,
70    Ideographic = 17,
71    IdsBinaryOperator = 18,
72    IdStart = 16,
73    IdsTrinaryOperator = 19,
74    IdsUnaryOperator = 67,
75    JoinControl = 20,
76    LogicalOrderException = 21,
77    Lowercase = 22,
78    Math = 23,
79    ModifierCombiningMark = 68,
80    NfcInert = 39,
81    NfdInert = 37,
82    NfkcInert = 40,
83    NfkdInert = 38,
84    NoncharacterCodePoint = 24,
85    PatternSyntax = 42,
86    PatternWhiteSpace = 43,
87    PrependedConcatenationMark = 63,
88    Print = 47,
89    QuotationMark = 25,
90    Radical = 26,
91    RegionalIndicator = 62,
92    SegmentStarter = 41,
93    SentenceTerminal = 35,
94    SoftDotted = 27,
95    TerminalPunctuation = 28,
96    UnifiedIdeograph = 29,
97    Uppercase = 30,
98    VariationSelector = 36,
99    WhiteSpace = 31,
100    Xdigit = 48,
101    XidContinue = 32,
102    XidStart = 33,
103}
104
105/// This type can represent any binary property over strings.
106///
107/// This is intended to be used in situations where the exact unicode property needed is
108/// only known at runtime, for example in regex engines.
109///
110/// The values are intended to be identical to ICU4C's UProperty enum
111#[non_exhaustive]
112#[derive(#[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::marker::Copy for StringBinaryProperty { }Copy, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::clone::Clone for StringBinaryProperty {
    #[inline]
    fn clone(&self) -> StringBinaryProperty { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialEq for StringBinaryProperty {
    #[inline]
    fn eq(&self, other: &StringBinaryProperty) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Eq for StringBinaryProperty {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialOrd for StringBinaryProperty {
    #[inline]
    fn partial_cmp(&self, other: &StringBinaryProperty)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Ord for StringBinaryProperty {
    #[inline]
    fn cmp(&self, other: &StringBinaryProperty) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::hash::Hash for StringBinaryProperty {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::fmt::Debug for StringBinaryProperty {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                StringBinaryProperty::BasicEmoji => "BasicEmoji",
                StringBinaryProperty::EmojiKeycapSequence =>
                    "EmojiKeycapSequence",
                StringBinaryProperty::RgiEmoji => "RgiEmoji",
                StringBinaryProperty::RgiEmojiFlagSequence =>
                    "RgiEmojiFlagSequence",
                StringBinaryProperty::RgiEmojiModifierSequence =>
                    "RgiEmojiModifierSequence",
                StringBinaryProperty::RgiEmojiTagSequence =>
                    "RgiEmojiTagSequence",
                StringBinaryProperty::RgiEmojiZWJSequence =>
                    "RgiEmojiZWJSequence",
            })
    }
}Debug)]
113#[allow(dead_code)]
114#[allow(missing_docs)]
115enum StringBinaryProperty {
116    BasicEmoji = 65,
117    EmojiKeycapSequence = 66,
118    RgiEmoji = 71,
119    RgiEmojiFlagSequence = 68,
120    RgiEmojiModifierSequence = 67,
121    RgiEmojiTagSequence = 69,
122    RgiEmojiZWJSequence = 70,
123}
124
125/// This type can represent any enumerated Unicode property.
126///
127/// This is intended to be used in situations where the exact unicode property needed is
128/// only known at runtime, for example in regex engines.
129///
130/// The values are intended to be identical to ICU4C's UProperty enum
131#[non_exhaustive]
132#[derive(#[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::marker::Copy for EnumeratedProperty { }Copy, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::clone::Clone for EnumeratedProperty {
    #[inline]
    fn clone(&self) -> EnumeratedProperty { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialEq for EnumeratedProperty {
    #[inline]
    fn eq(&self, other: &EnumeratedProperty) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Eq for EnumeratedProperty {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialOrd for EnumeratedProperty {
    #[inline]
    fn partial_cmp(&self, other: &EnumeratedProperty)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Ord for EnumeratedProperty {
    #[inline]
    fn cmp(&self, other: &EnumeratedProperty) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::hash::Hash for EnumeratedProperty {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::fmt::Debug for EnumeratedProperty {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                EnumeratedProperty::BidiClass => "BidiClass",
                EnumeratedProperty::BidiPairedBracketType =>
                    "BidiPairedBracketType",
                EnumeratedProperty::Block => "Block",
                EnumeratedProperty::CombiningClass => "CombiningClass",
                EnumeratedProperty::DecompositionType => "DecompositionType",
                EnumeratedProperty::EastAsianWidth => "EastAsianWidth",
                EnumeratedProperty::GeneralCategory => "GeneralCategory",
                EnumeratedProperty::GraphemeClusterBreak =>
                    "GraphemeClusterBreak",
                EnumeratedProperty::HangulSyllableType =>
                    "HangulSyllableType",
                EnumeratedProperty::IndicConjunctBreak =>
                    "IndicConjunctBreak",
                EnumeratedProperty::IndicPositionalCategory =>
                    "IndicPositionalCategory",
                EnumeratedProperty::IndicSyllabicCategory =>
                    "IndicSyllabicCategory",
                EnumeratedProperty::JoiningGroup => "JoiningGroup",
                EnumeratedProperty::JoiningType => "JoiningType",
                EnumeratedProperty::LeadCanonicalCombiningClass =>
                    "LeadCanonicalCombiningClass",
                EnumeratedProperty::LineBreak => "LineBreak",
                EnumeratedProperty::NFCQuickCheck => "NFCQuickCheck",
                EnumeratedProperty::NFDQuickCheck => "NFDQuickCheck",
                EnumeratedProperty::NFKCQuickCheck => "NFKCQuickCheck",
                EnumeratedProperty::NFKDQuickCheck => "NFKDQuickCheck",
                EnumeratedProperty::NumericType => "NumericType",
                EnumeratedProperty::Script => "Script",
                EnumeratedProperty::SentenceBreak => "SentenceBreak",
                EnumeratedProperty::TrailCanonicalCombiningClass =>
                    "TrailCanonicalCombiningClass",
                EnumeratedProperty::VerticalOrientation =>
                    "VerticalOrientation",
                EnumeratedProperty::WordBreak => "WordBreak",
            })
    }
}Debug)]
133#[allow(dead_code)]
134#[allow(missing_docs)]
135enum EnumeratedProperty {
136    BidiClass = 0x1000,
137    BidiPairedBracketType = 0x1015,
138    Block = 0x1001,
139    CombiningClass = 0x1002,
140    DecompositionType = 0x1003,
141    EastAsianWidth = 0x1004,
142    GeneralCategory = 0x1005,
143    GraphemeClusterBreak = 0x1012,
144    HangulSyllableType = 0x100B,
145    IndicConjunctBreak = 0x101A,
146    IndicPositionalCategory = 0x1016,
147    IndicSyllabicCategory = 0x1017,
148    JoiningGroup = 0x1006,
149    JoiningType = 0x1007,
150    LeadCanonicalCombiningClass = 0x1010,
151    LineBreak = 0x1008,
152    NFCQuickCheck = 0x100E,
153    NFDQuickCheck = 0x100C,
154    NFKCQuickCheck = 0x100F,
155    NFKDQuickCheck = 0x100D,
156    NumericType = 0x1009,
157    Script = 0x100A,
158    SentenceBreak = 0x1013,
159    TrailCanonicalCombiningClass = 0x1011,
160    VerticalOrientation = 0x1018,
161    WordBreak = 0x1014,
162}
163
164/// This type can represent any Unicode mask property.
165///
166/// This is intended to be used in situations where the exact unicode property needed is
167/// only known at runtime, for example in regex engines.
168///
169/// The values are intended to be identical to ICU4C's UProperty enum
170#[non_exhaustive]
171#[derive(#[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::marker::Copy for MaskProperty { }Copy, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::clone::Clone for MaskProperty {
    #[inline]
    fn clone(&self) -> MaskProperty { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialEq for MaskProperty {
    #[inline]
    fn eq(&self, other: &MaskProperty) -> bool { true }
}PartialEq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Eq for MaskProperty {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialOrd for MaskProperty {
    #[inline]
    fn partial_cmp(&self, other: &MaskProperty)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ordering::Equal)
    }
}PartialOrd, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Ord for MaskProperty {
    #[inline]
    fn cmp(&self, other: &MaskProperty) -> ::core::cmp::Ordering {
        ::core::cmp::Ordering::Equal
    }
}Ord, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::hash::Hash for MaskProperty {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
}Hash, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::fmt::Debug for MaskProperty {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f, "GeneralCategoryMask")
    }
}Debug)]
172#[allow(dead_code)]
173#[allow(missing_docs)]
174enum MaskProperty {
175    GeneralCategoryMask = 0x2000,
176}
177
178/// This type can represent any numeric Unicode property.
179///
180/// This is intended to be used in situations where the exact unicode property needed is
181/// only known at runtime, for example in regex engines.
182///
183/// The values are intended to be identical to ICU4C's UProperty enum
184#[non_exhaustive]
185#[derive(#[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::marker::Copy for NumericProperty { }Copy, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::clone::Clone for NumericProperty {
    #[inline]
    fn clone(&self) -> NumericProperty { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialEq for NumericProperty {
    #[inline]
    fn eq(&self, other: &NumericProperty) -> bool { true }
}PartialEq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Eq for NumericProperty {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialOrd for NumericProperty {
    #[inline]
    fn partial_cmp(&self, other: &NumericProperty)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ordering::Equal)
    }
}PartialOrd, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Ord for NumericProperty {
    #[inline]
    fn cmp(&self, other: &NumericProperty) -> ::core::cmp::Ordering {
        ::core::cmp::Ordering::Equal
    }
}Ord, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::hash::Hash for NumericProperty {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
}Hash, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::fmt::Debug for NumericProperty {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f, "NumericValue")
    }
}Debug)]
186#[allow(dead_code)]
187#[allow(missing_docs)]
188enum NumericProperty {
189    NumericValue = 0x3000,
190}
191
192/// This type can represent any Unicode string property.
193///
194/// This is intended to be used in situations where the exact unicode property needed is
195/// only known at runtime, for example in regex engines.
196///
197/// The values are intended to be identical to ICU4C's UProperty enum
198#[non_exhaustive]
199#[derive(#[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::marker::Copy for StringProperty { }Copy, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::clone::Clone for StringProperty {
    #[inline]
    fn clone(&self) -> StringProperty { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialEq for StringProperty {
    #[inline]
    fn eq(&self, other: &StringProperty) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Eq for StringProperty {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialOrd for StringProperty {
    #[inline]
    fn partial_cmp(&self, other: &StringProperty)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Ord for StringProperty {
    #[inline]
    fn cmp(&self, other: &StringProperty) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::hash::Hash for StringProperty {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::fmt::Debug for StringProperty {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                StringProperty::Age => "Age",
                StringProperty::BidiMirroringGlyph => "BidiMirroringGlyph",
                StringProperty::BidiPairedBracket => "BidiPairedBracket",
                StringProperty::CaseFolding => "CaseFolding",
                StringProperty::ISOComment => "ISOComment",
                StringProperty::LowercaseMapping => "LowercaseMapping",
                StringProperty::Name => "Name",
                StringProperty::SimpleCaseFolding => "SimpleCaseFolding",
                StringProperty::SimpleLowercaseMapping =>
                    "SimpleLowercaseMapping",
                StringProperty::SimpleTitlecaseMapping =>
                    "SimpleTitlecaseMapping",
                StringProperty::SimpleUppercaseMapping =>
                    "SimpleUppercaseMapping",
                StringProperty::TitlecaseMapping => "TitlecaseMapping",
                StringProperty::Unicode1Name => "Unicode1Name",
                StringProperty::UppercaseMapping => "UppercaseMapping",
            })
    }
}Debug)]
200#[allow(dead_code)]
201#[allow(missing_docs)]
202enum StringProperty {
203    Age = 0x4000,
204    BidiMirroringGlyph = 0x4001,
205    BidiPairedBracket = 0x400D,
206    CaseFolding = 0x4002,
207    ISOComment = 0x4003,
208    LowercaseMapping = 0x4004,
209    Name = 0x4005,
210    SimpleCaseFolding = 0x4006,
211    SimpleLowercaseMapping = 0x4007,
212    SimpleTitlecaseMapping = 0x4008,
213    SimpleUppercaseMapping = 0x4009,
214    TitlecaseMapping = 0x400A,
215    Unicode1Name = 0x400B,
216    UppercaseMapping = 0x400C,
217}
218
219#[non_exhaustive]
220#[derive(#[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::marker::Copy for MiscProperty { }Copy, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::clone::Clone for MiscProperty {
    #[inline]
    fn clone(&self) -> MiscProperty { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialEq for MiscProperty {
    #[inline]
    fn eq(&self, other: &MiscProperty) -> bool { true }
}PartialEq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Eq for MiscProperty {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::PartialOrd for MiscProperty {
    #[inline]
    fn partial_cmp(&self, other: &MiscProperty)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ordering::Equal)
    }
}PartialOrd, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::cmp::Ord for MiscProperty {
    #[inline]
    fn cmp(&self, other: &MiscProperty) -> ::core::cmp::Ordering {
        ::core::cmp::Ordering::Equal
    }
}Ord, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::hash::Hash for MiscProperty {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
}Hash, #[automatically_derived]
#[allow(dead_code)]
#[allow(missing_docs)]
impl ::core::fmt::Debug for MiscProperty {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f, "ScriptExtensions")
    }
}Debug)]
221#[allow(dead_code)]
222#[allow(missing_docs)]
223enum MiscProperty {
224    ScriptExtensions = 0x7000,
225}
226
227impl CodePointSetData {
228    /// Returns a type capable of looking up values for a property specified as a string, as long as it is a
229    /// [binary property listed in ECMA-262][ecma], using strict matching on the names in the spec.
230    ///
231    /// This handles every property required by ECMA-262 `/u` regular expressions, except for:
232    ///
233    /// - `Script` and `General_Category`: handle these directly using property values parsed via
234    ///   [`PropertyParser<GeneralCategory>`] and [`PropertyParser<Script>`]
235    ///   if necessary.
236    /// - `Script_Extensions`: handle this directly using APIs from [`crate::script::ScriptWithExtensions`]
237    /// - `General_Category` mask values: Handle this alongside `General_Category` using [`GeneralCategoryGroup`],
238    ///   using property values parsed via [`PropertyParser<GeneralCategory>`] if necessary
239    /// - `Assigned`, `All`, and `ASCII` pseudoproperties: Handle these using their equivalent sets:
240    ///    - `Any` can be expressed as the range `[\u{0}-\u{10FFFF}]`
241    ///    - `Assigned` can be expressed as the inverse of the set `gc=Cn` (i.e., `\P{gc=Cn}`).
242    ///    - `ASCII` can be expressed as the range `[\u{0}-\u{7F}]`
243    /// - `General_Category` property values can themselves be treated like properties using a shorthand in ECMA262,
244    ///   simply create the corresponding `GeneralCategory` set.
245    ///
246    /// ✨ *Enabled with the `compiled_data` Cargo feature.*
247    ///
248    /// [📚 Help choosing a constructor](icu_provider::constructors)
249    ///
250    /// ```
251    /// use icu::properties::CodePointSetData;
252    ///
253    /// let emoji = CodePointSetData::new_for_ecma262(b"Emoji")
254    ///     .expect("is an ECMA-262 property");
255    ///
256    /// assert!(emoji.contains('🔥')); // U+1F525 FIRE
257    /// assert!(!emoji.contains('V'));
258    /// ```
259    ///
260    /// [ecma]: https://tc39.es/ecma262/#table-binary-unicode-properties
261    #[cfg(feature = "compiled_data")]
262    pub fn new_for_ecma262(prop: &[u8]) -> Option<crate::CodePointSetDataBorrowed<'static>> {
263        use crate::props::*;
264        Some(match prop {
265            AsciiHexDigit::NAME | AsciiHexDigit::SHORT_NAME => Self::new::<AsciiHexDigit>(),
266            Alphabetic::NAME | Alphabetic::SHORT_NAME => Self::new::<Alphabetic>(),
267            BidiControl::NAME | BidiControl::SHORT_NAME => Self::new::<BidiControl>(),
268            BidiMirrored::NAME | BidiMirrored::SHORT_NAME => Self::new::<BidiMirrored>(),
269            CaseIgnorable::NAME | CaseIgnorable::SHORT_NAME => Self::new::<CaseIgnorable>(),
270            #[allow(unreachable_patterns)] // no short name
271            Cased::NAME | Cased::SHORT_NAME => Self::new::<Cased>(),
272            ChangesWhenCasefolded::NAME | ChangesWhenCasefolded::SHORT_NAME => {
273                Self::new::<ChangesWhenCasefolded>()
274            }
275            ChangesWhenCasemapped::NAME | ChangesWhenCasemapped::SHORT_NAME => {
276                Self::new::<ChangesWhenCasemapped>()
277            }
278            ChangesWhenLowercased::NAME | ChangesWhenLowercased::SHORT_NAME => {
279                Self::new::<ChangesWhenLowercased>()
280            }
281            ChangesWhenNfkcCasefolded::NAME | ChangesWhenNfkcCasefolded::SHORT_NAME => {
282                Self::new::<ChangesWhenNfkcCasefolded>()
283            }
284            ChangesWhenTitlecased::NAME | ChangesWhenTitlecased::SHORT_NAME => {
285                Self::new::<ChangesWhenTitlecased>()
286            }
287            ChangesWhenUppercased::NAME | ChangesWhenUppercased::SHORT_NAME => {
288                Self::new::<ChangesWhenUppercased>()
289            }
290            #[allow(unreachable_patterns)] // no short name
291            Dash::NAME | Dash::SHORT_NAME => Self::new::<Dash>(),
292            DefaultIgnorableCodePoint::NAME | DefaultIgnorableCodePoint::SHORT_NAME => {
293                Self::new::<DefaultIgnorableCodePoint>()
294            }
295            Deprecated::NAME | Deprecated::SHORT_NAME => Self::new::<Deprecated>(),
296            Diacritic::NAME | Diacritic::SHORT_NAME => Self::new::<Diacritic>(),
297            #[allow(unreachable_patterns)] // no short name
298            Emoji::NAME | Emoji::SHORT_NAME => Self::new::<Emoji>(),
299            EmojiComponent::NAME | EmojiComponent::SHORT_NAME => Self::new::<EmojiComponent>(),
300            EmojiModifier::NAME | EmojiModifier::SHORT_NAME => Self::new::<EmojiModifier>(),
301            EmojiModifierBase::NAME | EmojiModifierBase::SHORT_NAME => {
302                Self::new::<EmojiModifierBase>()
303            }
304            EmojiPresentation::NAME | EmojiPresentation::SHORT_NAME => {
305                Self::new::<EmojiPresentation>()
306            }
307            ExtendedPictographic::NAME | ExtendedPictographic::SHORT_NAME => {
308                Self::new::<ExtendedPictographic>()
309            }
310            Extender::NAME | Extender::SHORT_NAME => Self::new::<Extender>(),
311            GraphemeBase::NAME | GraphemeBase::SHORT_NAME => Self::new::<GraphemeBase>(),
312            GraphemeExtend::NAME | GraphemeExtend::SHORT_NAME => Self::new::<GraphemeExtend>(),
313            HexDigit::NAME | HexDigit::SHORT_NAME => Self::new::<HexDigit>(),
314            IdsBinaryOperator::NAME | IdsBinaryOperator::SHORT_NAME => {
315                Self::new::<IdsBinaryOperator>()
316            }
317            IdsTrinaryOperator::NAME | IdsTrinaryOperator::SHORT_NAME => {
318                Self::new::<IdsTrinaryOperator>()
319            }
320            IdContinue::NAME | IdContinue::SHORT_NAME => Self::new::<IdContinue>(),
321            IdStart::NAME | IdStart::SHORT_NAME => Self::new::<IdStart>(),
322            Ideographic::NAME | Ideographic::SHORT_NAME => Self::new::<Ideographic>(),
323            JoinControl::NAME | JoinControl::SHORT_NAME => Self::new::<JoinControl>(),
324            LogicalOrderException::NAME | LogicalOrderException::SHORT_NAME => {
325                Self::new::<LogicalOrderException>()
326            }
327            Lowercase::NAME | Lowercase::SHORT_NAME => Self::new::<Lowercase>(),
328            #[allow(unreachable_patterns)] // no short name
329            Math::NAME | Math::SHORT_NAME => Self::new::<Math>(),
330            NoncharacterCodePoint::NAME | NoncharacterCodePoint::SHORT_NAME => {
331                Self::new::<NoncharacterCodePoint>()
332            }
333            PatternSyntax::NAME | PatternSyntax::SHORT_NAME => Self::new::<PatternSyntax>(),
334            PatternWhiteSpace::NAME | PatternWhiteSpace::SHORT_NAME => {
335                Self::new::<PatternWhiteSpace>()
336            }
337            QuotationMark::NAME | QuotationMark::SHORT_NAME => Self::new::<QuotationMark>(),
338            #[allow(unreachable_patterns)] // no short name
339            Radical::NAME | Radical::SHORT_NAME => Self::new::<Radical>(),
340            RegionalIndicator::NAME | RegionalIndicator::SHORT_NAME => {
341                Self::new::<RegionalIndicator>()
342            }
343            SentenceTerminal::NAME | SentenceTerminal::SHORT_NAME => {
344                Self::new::<SentenceTerminal>()
345            }
346            SoftDotted::NAME | SoftDotted::SHORT_NAME => Self::new::<SoftDotted>(),
347            TerminalPunctuation::NAME | TerminalPunctuation::SHORT_NAME => {
348                Self::new::<TerminalPunctuation>()
349            }
350            UnifiedIdeograph::NAME | UnifiedIdeograph::SHORT_NAME => {
351                Self::new::<UnifiedIdeograph>()
352            }
353            Uppercase::NAME | Uppercase::SHORT_NAME => Self::new::<Uppercase>(),
354            VariationSelector::NAME | VariationSelector::SHORT_NAME => {
355                Self::new::<VariationSelector>()
356            }
357            WhiteSpace::NAME | WhiteSpace::SHORT_NAME => Self::new::<WhiteSpace>(),
358            XidContinue::NAME | XidContinue::SHORT_NAME => Self::new::<XidContinue>(),
359            XidStart::NAME | XidStart::SHORT_NAME => Self::new::<XidStart>(),
360            // Not an ECMA-262 property
361            _ => return None,
362        })
363    }
364
365    icu_provider::gen_buffer_data_constructors!(
366        (prop: &[u8]) -> result: Option<Result<Self, DataError>>,
367        functions: [
368            new_for_ecma262: skip,
369            try_new_for_ecma262_with_buffer_provider,
370            try_new_for_ecma262_unstable,
371            Self,
372        ]
373    );
374
375    #[doc = "A version of [`Self::new_for_ecma262`] that uses custom data provided by a [`DataProvider`].\n\n[\u{1f4da} Help choosing a constructor](icu_provider::constructors)\n\n<div class=\"stab unstable\">\u{26a0}\u{fe0f} The bounds on <tt>provider</tt> may change over time, including in SemVer minor releases.</div>"icu_provider::gen_buffer_unstable_docs!(UNSTABLE, Self::new_for_ecma262)]
376    pub fn try_new_for_ecma262_unstable<P>(
377        provider: &P,
378        prop: &[u8],
379    ) -> Option<Result<Self, DataError>>
380    where
381        P: ?Sized
382            + DataProvider<PropertyBinaryAsciiHexDigitV1>
383            + DataProvider<PropertyBinaryAlphabeticV1>
384            + DataProvider<PropertyBinaryBidiControlV1>
385            + DataProvider<PropertyBinaryBidiMirroredV1>
386            + DataProvider<PropertyBinaryCaseIgnorableV1>
387            + DataProvider<PropertyBinaryCasedV1>
388            + DataProvider<PropertyBinaryChangesWhenCasefoldedV1>
389            + DataProvider<PropertyBinaryChangesWhenCasemappedV1>
390            + DataProvider<PropertyBinaryChangesWhenLowercasedV1>
391            + DataProvider<PropertyBinaryChangesWhenNfkcCasefoldedV1>
392            + DataProvider<PropertyBinaryChangesWhenTitlecasedV1>
393            + DataProvider<PropertyBinaryChangesWhenUppercasedV1>
394            + DataProvider<PropertyBinaryDashV1>
395            + DataProvider<PropertyBinaryDefaultIgnorableCodePointV1>
396            + DataProvider<PropertyBinaryDeprecatedV1>
397            + DataProvider<PropertyBinaryDiacriticV1>
398            + DataProvider<PropertyBinaryEmojiV1>
399            + DataProvider<PropertyBinaryEmojiComponentV1>
400            + DataProvider<PropertyBinaryEmojiModifierV1>
401            + DataProvider<PropertyBinaryEmojiModifierBaseV1>
402            + DataProvider<PropertyBinaryEmojiPresentationV1>
403            + DataProvider<PropertyBinaryExtendedPictographicV1>
404            + DataProvider<PropertyBinaryExtenderV1>
405            + DataProvider<PropertyBinaryGraphemeBaseV1>
406            + DataProvider<PropertyBinaryGraphemeExtendV1>
407            + DataProvider<PropertyBinaryHexDigitV1>
408            + DataProvider<PropertyBinaryIdsBinaryOperatorV1>
409            + DataProvider<PropertyBinaryIdsTrinaryOperatorV1>
410            + DataProvider<PropertyBinaryIdContinueV1>
411            + DataProvider<PropertyBinaryIdStartV1>
412            + DataProvider<PropertyBinaryIdeographicV1>
413            + DataProvider<PropertyBinaryJoinControlV1>
414            + DataProvider<PropertyBinaryLogicalOrderExceptionV1>
415            + DataProvider<PropertyBinaryLowercaseV1>
416            + DataProvider<PropertyBinaryMathV1>
417            + DataProvider<PropertyBinaryNoncharacterCodePointV1>
418            + DataProvider<PropertyBinaryPatternSyntaxV1>
419            + DataProvider<PropertyBinaryPatternWhiteSpaceV1>
420            + DataProvider<PropertyBinaryQuotationMarkV1>
421            + DataProvider<PropertyBinaryRadicalV1>
422            + DataProvider<PropertyBinaryRegionalIndicatorV1>
423            + DataProvider<PropertyBinarySentenceTerminalV1>
424            + DataProvider<PropertyBinarySoftDottedV1>
425            + DataProvider<PropertyBinaryTerminalPunctuationV1>
426            + DataProvider<PropertyBinaryUnifiedIdeographV1>
427            + DataProvider<PropertyBinaryUppercaseV1>
428            + DataProvider<PropertyBinaryVariationSelectorV1>
429            + DataProvider<PropertyBinaryWhiteSpaceV1>
430            + DataProvider<PropertyBinaryXidContinueV1>
431            + DataProvider<PropertyBinaryXidStartV1>,
432    {
433        use crate::props::*;
434        Some(match prop {
435            AsciiHexDigit::NAME | AsciiHexDigit::SHORT_NAME => {
436                Self::try_new_unstable::<AsciiHexDigit>(provider)
437            }
438            Alphabetic::NAME | Alphabetic::SHORT_NAME => {
439                Self::try_new_unstable::<Alphabetic>(provider)
440            }
441            BidiControl::NAME | BidiControl::SHORT_NAME => {
442                Self::try_new_unstable::<BidiControl>(provider)
443            }
444            BidiMirrored::NAME | BidiMirrored::SHORT_NAME => {
445                Self::try_new_unstable::<BidiMirrored>(provider)
446            }
447            CaseIgnorable::NAME | CaseIgnorable::SHORT_NAME => {
448                Self::try_new_unstable::<CaseIgnorable>(provider)
449            }
450            #[allow(unreachable_patterns)] // no short name
451            Cased::NAME | Cased::SHORT_NAME => Self::try_new_unstable::<Cased>(provider),
452            ChangesWhenCasefolded::NAME | ChangesWhenCasefolded::SHORT_NAME => {
453                Self::try_new_unstable::<ChangesWhenCasefolded>(provider)
454            }
455            ChangesWhenCasemapped::NAME | ChangesWhenCasemapped::SHORT_NAME => {
456                Self::try_new_unstable::<ChangesWhenCasemapped>(provider)
457            }
458            ChangesWhenLowercased::NAME | ChangesWhenLowercased::SHORT_NAME => {
459                Self::try_new_unstable::<ChangesWhenLowercased>(provider)
460            }
461            ChangesWhenNfkcCasefolded::NAME | ChangesWhenNfkcCasefolded::SHORT_NAME => {
462                Self::try_new_unstable::<ChangesWhenNfkcCasefolded>(provider)
463            }
464            ChangesWhenTitlecased::NAME | ChangesWhenTitlecased::SHORT_NAME => {
465                Self::try_new_unstable::<ChangesWhenTitlecased>(provider)
466            }
467            ChangesWhenUppercased::NAME | ChangesWhenUppercased::SHORT_NAME => {
468                Self::try_new_unstable::<ChangesWhenUppercased>(provider)
469            }
470            #[allow(unreachable_patterns)] // no short name
471            Dash::NAME | Dash::SHORT_NAME => Self::try_new_unstable::<Dash>(provider),
472            DefaultIgnorableCodePoint::NAME | DefaultIgnorableCodePoint::SHORT_NAME => {
473                Self::try_new_unstable::<DefaultIgnorableCodePoint>(provider)
474            }
475            Deprecated::NAME | Deprecated::SHORT_NAME => {
476                Self::try_new_unstable::<Deprecated>(provider)
477            }
478            Diacritic::NAME | Diacritic::SHORT_NAME => {
479                Self::try_new_unstable::<Diacritic>(provider)
480            }
481            #[allow(unreachable_patterns)] // no short name
482            Emoji::NAME | Emoji::SHORT_NAME => Self::try_new_unstable::<Emoji>(provider),
483            EmojiComponent::NAME | EmojiComponent::SHORT_NAME => {
484                Self::try_new_unstable::<EmojiComponent>(provider)
485            }
486            EmojiModifier::NAME | EmojiModifier::SHORT_NAME => {
487                Self::try_new_unstable::<EmojiModifier>(provider)
488            }
489            EmojiModifierBase::NAME | EmojiModifierBase::SHORT_NAME => {
490                Self::try_new_unstable::<EmojiModifierBase>(provider)
491            }
492            EmojiPresentation::NAME | EmojiPresentation::SHORT_NAME => {
493                Self::try_new_unstable::<EmojiPresentation>(provider)
494            }
495            ExtendedPictographic::NAME | ExtendedPictographic::SHORT_NAME => {
496                Self::try_new_unstable::<ExtendedPictographic>(provider)
497            }
498            Extender::NAME | Extender::SHORT_NAME => Self::try_new_unstable::<Extender>(provider),
499            GraphemeBase::NAME | GraphemeBase::SHORT_NAME => {
500                Self::try_new_unstable::<GraphemeBase>(provider)
501            }
502            GraphemeExtend::NAME | GraphemeExtend::SHORT_NAME => {
503                Self::try_new_unstable::<GraphemeExtend>(provider)
504            }
505            HexDigit::NAME | HexDigit::SHORT_NAME => Self::try_new_unstable::<HexDigit>(provider),
506            IdsBinaryOperator::NAME | IdsBinaryOperator::SHORT_NAME => {
507                Self::try_new_unstable::<IdsBinaryOperator>(provider)
508            }
509            IdsTrinaryOperator::NAME | IdsTrinaryOperator::SHORT_NAME => {
510                Self::try_new_unstable::<IdsTrinaryOperator>(provider)
511            }
512            IdContinue::NAME | IdContinue::SHORT_NAME => {
513                Self::try_new_unstable::<IdContinue>(provider)
514            }
515            IdStart::NAME | IdStart::SHORT_NAME => Self::try_new_unstable::<IdStart>(provider),
516            Ideographic::NAME | Ideographic::SHORT_NAME => {
517                Self::try_new_unstable::<Ideographic>(provider)
518            }
519            JoinControl::NAME | JoinControl::SHORT_NAME => {
520                Self::try_new_unstable::<JoinControl>(provider)
521            }
522            LogicalOrderException::NAME | LogicalOrderException::SHORT_NAME => {
523                Self::try_new_unstable::<LogicalOrderException>(provider)
524            }
525            Lowercase::NAME | Lowercase::SHORT_NAME => {
526                Self::try_new_unstable::<Lowercase>(provider)
527            }
528            #[allow(unreachable_patterns)] // no short name
529            Math::NAME | Math::SHORT_NAME => Self::try_new_unstable::<Math>(provider),
530            NoncharacterCodePoint::NAME | NoncharacterCodePoint::SHORT_NAME => {
531                Self::try_new_unstable::<NoncharacterCodePoint>(provider)
532            }
533            PatternSyntax::NAME | PatternSyntax::SHORT_NAME => {
534                Self::try_new_unstable::<PatternSyntax>(provider)
535            }
536            PatternWhiteSpace::NAME | PatternWhiteSpace::SHORT_NAME => {
537                Self::try_new_unstable::<PatternWhiteSpace>(provider)
538            }
539            QuotationMark::NAME | QuotationMark::SHORT_NAME => {
540                Self::try_new_unstable::<QuotationMark>(provider)
541            }
542            #[allow(unreachable_patterns)] // no short name
543            Radical::NAME | Radical::SHORT_NAME => Self::try_new_unstable::<Radical>(provider),
544            RegionalIndicator::NAME | RegionalIndicator::SHORT_NAME => {
545                Self::try_new_unstable::<RegionalIndicator>(provider)
546            }
547            SentenceTerminal::NAME | SentenceTerminal::SHORT_NAME => {
548                Self::try_new_unstable::<SentenceTerminal>(provider)
549            }
550            SoftDotted::NAME | SoftDotted::SHORT_NAME => {
551                Self::try_new_unstable::<SoftDotted>(provider)
552            }
553            TerminalPunctuation::NAME | TerminalPunctuation::SHORT_NAME => {
554                Self::try_new_unstable::<TerminalPunctuation>(provider)
555            }
556            UnifiedIdeograph::NAME | UnifiedIdeograph::SHORT_NAME => {
557                Self::try_new_unstable::<UnifiedIdeograph>(provider)
558            }
559            Uppercase::NAME | Uppercase::SHORT_NAME => {
560                Self::try_new_unstable::<Uppercase>(provider)
561            }
562            VariationSelector::NAME | VariationSelector::SHORT_NAME => {
563                Self::try_new_unstable::<VariationSelector>(provider)
564            }
565            WhiteSpace::NAME | WhiteSpace::SHORT_NAME => {
566                Self::try_new_unstable::<WhiteSpace>(provider)
567            }
568            XidContinue::NAME | XidContinue::SHORT_NAME => {
569                Self::try_new_unstable::<XidContinue>(provider)
570            }
571            XidStart::NAME | XidStart::SHORT_NAME => Self::try_new_unstable::<XidStart>(provider),
572            // Not an ECMA-262 property
573            _ => return None,
574        })
575    }
576}