Skip to main content

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