#![allow(clippy::exhaustive_structs, clippy::exhaustive_enums)]
pub mod names;
pub use names::{
BidiClassNameToValueV2, BidiClassValueToLongNameV1, BidiClassValueToShortNameV1,
CanonicalCombiningClassNameToValueV2, CanonicalCombiningClassValueToLongNameV1,
CanonicalCombiningClassValueToShortNameV1, EastAsianWidthNameToValueV2,
EastAsianWidthValueToLongNameV1, EastAsianWidthValueToShortNameV1,
GeneralCategoryMaskNameToValueV2, GeneralCategoryNameToValueV2,
GeneralCategoryValueToLongNameV1, GeneralCategoryValueToShortNameV1,
GraphemeClusterBreakNameToValueV2, GraphemeClusterBreakValueToLongNameV1,
GraphemeClusterBreakValueToShortNameV1, HangulSyllableTypeNameToValueV2,
HangulSyllableTypeValueToLongNameV1, HangulSyllableTypeValueToShortNameV1,
IndicSyllabicCategoryNameToValueV2, IndicSyllabicCategoryValueToLongNameV1,
IndicSyllabicCategoryValueToShortNameV1, JoiningTypeNameToValueV2,
JoiningTypeValueToLongNameV1, JoiningTypeValueToShortNameV1, LineBreakNameToValueV2,
LineBreakValueToLongNameV1, LineBreakValueToShortNameV1, ScriptNameToValueV2,
ScriptValueToLongNameV1, ScriptValueToShortNameV1, SentenceBreakNameToValueV2,
SentenceBreakValueToLongNameV1, SentenceBreakValueToShortNameV1, WordBreakNameToValueV2,
WordBreakValueToLongNameV1, WordBreakValueToShortNameV1,
};
pub use crate::props::gc::GeneralCategoryULE;
use crate::props::*;
use crate::script::ScriptWithExt;
use core::ops::RangeInclusive;
use icu_collections::codepointinvlist::CodePointInversionList;
use icu_collections::codepointinvliststringlist::CodePointInversionListAndStringList;
use icu_collections::codepointtrie::{CodePointMapRange, CodePointTrie, TrieValue};
use icu_provider::prelude::*;
use zerofrom::ZeroFrom;
use zerovec::{VarZeroVec, ZeroSlice};
#[cfg(feature = "compiled_data")]
#[derive(Debug)]
pub struct Baked;
#[cfg(feature = "compiled_data")]
#[allow(unused_imports)]
const _: () = {
use icu_properties_data::*;
pub mod icu {
pub use crate as properties;
pub use icu_collections as collections;
}
make_provider!(Baked);
impl_alnum_v1!(Baked);
impl_alphabetic_v1!(Baked);
impl_ascii_hex_digit_v1!(Baked);
impl_basic_emoji_v1!(Baked);
impl_bidi_class_name_to_value_v2!(Baked);
impl_bidi_class_v1!(Baked);
impl_bidi_class_value_to_long_name_v1!(Baked);
impl_bidi_class_value_to_short_name_v1!(Baked);
impl_bidi_control_v1!(Baked);
impl_bidi_mirrored_v1!(Baked);
impl_bidi_mirroring_glyph_v1!(Baked);
impl_blank_v1!(Baked);
impl_canonical_combining_class_name_to_value_v2!(Baked);
impl_canonical_combining_class_v1!(Baked);
impl_canonical_combining_class_value_to_long_name_v1!(Baked);
impl_canonical_combining_class_value_to_short_name_v1!(Baked);
impl_case_ignorable_v1!(Baked);
impl_case_sensitive_v1!(Baked);
impl_cased_v1!(Baked);
impl_changes_when_casefolded_v1!(Baked);
impl_changes_when_casemapped_v1!(Baked);
impl_changes_when_lowercased_v1!(Baked);
impl_changes_when_nfkc_casefolded_v1!(Baked);
impl_changes_when_titlecased_v1!(Baked);
impl_changes_when_uppercased_v1!(Baked);
impl_dash_v1!(Baked);
impl_default_ignorable_code_point_v1!(Baked);
impl_deprecated_v1!(Baked);
impl_diacritic_v1!(Baked);
impl_east_asian_width_name_to_value_v2!(Baked);
impl_east_asian_width_v1!(Baked);
impl_east_asian_width_value_to_long_name_v1!(Baked);
impl_east_asian_width_value_to_short_name_v1!(Baked);
impl_emoji_component_v1!(Baked);
impl_emoji_modifier_base_v1!(Baked);
impl_emoji_modifier_v1!(Baked);
impl_emoji_presentation_v1!(Baked);
impl_emoji_v1!(Baked);
impl_extended_pictographic_v1!(Baked);
impl_extender_v1!(Baked);
impl_full_composition_exclusion_v1!(Baked);
impl_general_category_mask_name_to_value_v2!(Baked);
impl_general_category_name_to_value_v2!(Baked);
impl_general_category_v1!(Baked);
impl_general_category_value_to_long_name_v1!(Baked);
impl_general_category_value_to_short_name_v1!(Baked);
impl_graph_v1!(Baked);
impl_grapheme_base_v1!(Baked);
impl_grapheme_cluster_break_name_to_value_v2!(Baked);
impl_grapheme_cluster_break_v1!(Baked);
impl_grapheme_cluster_break_value_to_long_name_v1!(Baked);
impl_grapheme_cluster_break_value_to_short_name_v1!(Baked);
impl_grapheme_extend_v1!(Baked);
impl_grapheme_link_v1!(Baked);
impl_hangul_syllable_type_name_to_value_v2!(Baked);
impl_hangul_syllable_type_v1!(Baked);
impl_hangul_syllable_type_value_to_long_name_v1!(Baked);
impl_hangul_syllable_type_value_to_short_name_v1!(Baked);
impl_hex_digit_v1!(Baked);
impl_hyphen_v1!(Baked);
impl_id_continue_v1!(Baked);
impl_id_start_v1!(Baked);
impl_ideographic_v1!(Baked);
impl_ids_binary_operator_v1!(Baked);
impl_ids_trinary_operator_v1!(Baked);
impl_indic_syllabic_category_name_to_value_v2!(Baked);
impl_indic_syllabic_category_v1!(Baked);
impl_indic_syllabic_category_value_to_long_name_v1!(Baked);
impl_indic_syllabic_category_value_to_short_name_v1!(Baked);
impl_join_control_v1!(Baked);
impl_joining_type_name_to_value_v2!(Baked);
impl_joining_type_v1!(Baked);
impl_joining_type_value_to_long_name_v1!(Baked);
impl_joining_type_value_to_short_name_v1!(Baked);
impl_line_break_name_to_value_v2!(Baked);
impl_line_break_v1!(Baked);
impl_line_break_value_to_long_name_v1!(Baked);
impl_line_break_value_to_short_name_v1!(Baked);
impl_logical_order_exception_v1!(Baked);
impl_lowercase_v1!(Baked);
impl_math_v1!(Baked);
impl_nfc_inert_v1!(Baked);
impl_nfd_inert_v1!(Baked);
impl_nfkc_inert_v1!(Baked);
impl_nfkd_inert_v1!(Baked);
impl_noncharacter_code_point_v1!(Baked);
impl_pattern_syntax_v1!(Baked);
impl_pattern_white_space_v1!(Baked);
impl_prepended_concatenation_mark_v1!(Baked);
impl_print_v1!(Baked);
impl_quotation_mark_v1!(Baked);
impl_radical_v1!(Baked);
impl_regional_indicator_v1!(Baked);
impl_script_name_to_value_v2!(Baked);
impl_script_v1!(Baked);
impl_script_value_to_long_name_v1!(Baked);
impl_script_value_to_short_name_v1!(Baked);
impl_script_with_extensions_property_v1!(Baked);
impl_segment_starter_v1!(Baked);
impl_sentence_break_name_to_value_v2!(Baked);
impl_sentence_break_v1!(Baked);
impl_sentence_break_value_to_long_name_v1!(Baked);
impl_sentence_break_value_to_short_name_v1!(Baked);
impl_sentence_terminal_v1!(Baked);
impl_soft_dotted_v1!(Baked);
impl_terminal_punctuation_v1!(Baked);
impl_unified_ideograph_v1!(Baked);
impl_uppercase_v1!(Baked);
impl_variation_selector_v1!(Baked);
impl_white_space_v1!(Baked);
impl_word_break_name_to_value_v2!(Baked);
impl_word_break_v1!(Baked);
impl_word_break_value_to_long_name_v1!(Baked);
impl_word_break_value_to_short_name_v1!(Baked);
impl_xdigit_v1!(Baked);
impl_xid_continue_v1!(Baked);
impl_xid_start_v1!(Baked);
};
icu_provider::data_marker!(
AlnumV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
AlphabeticV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
AsciiHexDigitV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
BidiControlV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
BidiMirroredV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
BlankV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
CasedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
CaseIgnorableV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
CaseSensitiveV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ChangesWhenCasefoldedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ChangesWhenCasemappedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ChangesWhenLowercasedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ChangesWhenNfkcCasefoldedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ChangesWhenTitlecasedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ChangesWhenUppercasedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
DashV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
DefaultIgnorableCodePointV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
DeprecatedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
DiacriticV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
EmojiComponentV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
EmojiModifierBaseV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
EmojiModifierV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
EmojiPresentationV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
EmojiV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ExtendedPictographicV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ExtenderV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
FullCompositionExclusionV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
GraphemeBaseV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
GraphemeExtendV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
GraphemeLinkV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
GraphV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
HexDigitV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
HyphenV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
IdContinueV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
IdeographicV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
IdsBinaryOperatorV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
IdStartV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
IdsTrinaryOperatorV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
JoinControlV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
LogicalOrderExceptionV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
LowercaseV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
MathV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
NfcInertV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
NfdInertV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
NfkcInertV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
NfkdInertV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
NoncharacterCodePointV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
PatternSyntaxV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
PatternWhiteSpaceV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
PrependedConcatenationMarkV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
PrintV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
QuotationMarkV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
RadicalV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
RegionalIndicatorV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
SegmentStarterV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
SentenceTerminalV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
SoftDottedV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
TerminalPunctuationV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
UnifiedIdeographV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
UppercaseV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
VariationSelectorV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
WhiteSpaceV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
XdigitV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
XidContinueV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
XidStartV1,
PropertyCodePointSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
BidiClassV1,
PropertyCodePointMap<'static, crate::props::BidiClass>,
is_singleton = true,
);
icu_provider::data_marker!(
CanonicalCombiningClassV1,
PropertyCodePointMap<'static, crate::props::CanonicalCombiningClass>,
is_singleton = true,
);
icu_provider::data_marker!(
EastAsianWidthV1,
PropertyCodePointMap<'static, crate::props::EastAsianWidth>,
is_singleton = true,
);
icu_provider::data_marker!(
GeneralCategoryV1,
PropertyCodePointMap<'static, crate::props::GeneralCategory>,
is_singleton = true,
);
icu_provider::data_marker!(
GraphemeClusterBreakV1,
PropertyCodePointMap<'static, crate::props::GraphemeClusterBreak>,
is_singleton = true,
);
icu_provider::data_marker!(
HangulSyllableTypeV1,
PropertyCodePointMap<'static, crate::props::HangulSyllableType>,
is_singleton = true,
);
icu_provider::data_marker!(
IndicSyllabicCategoryV1,
PropertyCodePointMap<'static, crate::props::IndicSyllabicCategory>,
is_singleton = true,
);
icu_provider::data_marker!(
JoiningTypeV1,
PropertyCodePointMap<'static, crate::props::JoiningType>,
is_singleton = true,
);
icu_provider::data_marker!(
LineBreakV1,
PropertyCodePointMap<'static, crate::props::LineBreak>,
is_singleton = true,
);
icu_provider::data_marker!(
ScriptV1,
PropertyCodePointMap<'static, crate::props::Script>,
is_singleton = true,
);
icu_provider::data_marker!(
SentenceBreakV1,
PropertyCodePointMap<'static, crate::props::SentenceBreak>,
is_singleton = true,
);
icu_provider::data_marker!(
WordBreakV1,
PropertyCodePointMap<'static, crate::props::WordBreak>,
is_singleton = true,
);
icu_provider::data_marker!(
BidiMirroringGlyphV1,
PropertyCodePointMap<'static, crate::bidi::BidiMirroringGlyph>,
is_singleton = true,
);
icu_provider::data_marker!(
BasicEmojiV1,
PropertyUnicodeSet<'static>,
is_singleton = true
);
icu_provider::data_marker!(
ScriptWithExtensionsPropertyV1,
ScriptWithExtensionsProperty<'static>,
is_singleton = true
);
pub const MARKERS: &[DataMarkerInfo] = &[
AlnumV1::INFO,
AlphabeticV1::INFO,
AsciiHexDigitV1::INFO,
BasicEmojiV1::INFO,
BidiControlV1::INFO,
BidiMirroredV1::INFO,
BidiMirroringGlyphV1::INFO,
BlankV1::INFO,
CasedV1::INFO,
CaseIgnorableV1::INFO,
CaseSensitiveV1::INFO,
ChangesWhenCasefoldedV1::INFO,
ChangesWhenCasemappedV1::INFO,
ChangesWhenLowercasedV1::INFO,
ChangesWhenNfkcCasefoldedV1::INFO,
ChangesWhenTitlecasedV1::INFO,
ChangesWhenUppercasedV1::INFO,
DashV1::INFO,
DefaultIgnorableCodePointV1::INFO,
DeprecatedV1::INFO,
DiacriticV1::INFO,
EmojiComponentV1::INFO,
EmojiModifierBaseV1::INFO,
EmojiModifierV1::INFO,
EmojiPresentationV1::INFO,
EmojiV1::INFO,
ExtendedPictographicV1::INFO,
ExtenderV1::INFO,
FullCompositionExclusionV1::INFO,
GraphemeBaseV1::INFO,
GraphemeExtendV1::INFO,
GraphemeLinkV1::INFO,
GraphV1::INFO,
HexDigitV1::INFO,
HyphenV1::INFO,
IdContinueV1::INFO,
IdeographicV1::INFO,
IdsBinaryOperatorV1::INFO,
IdStartV1::INFO,
IdsTrinaryOperatorV1::INFO,
JoinControlV1::INFO,
LogicalOrderExceptionV1::INFO,
LowercaseV1::INFO,
MathV1::INFO,
NfcInertV1::INFO,
NfdInertV1::INFO,
NfkcInertV1::INFO,
NfkdInertV1::INFO,
NoncharacterCodePointV1::INFO,
PatternSyntaxV1::INFO,
PatternWhiteSpaceV1::INFO,
PrependedConcatenationMarkV1::INFO,
PrintV1::INFO,
QuotationMarkV1::INFO,
RadicalV1::INFO,
RegionalIndicatorV1::INFO,
ScriptWithExtensionsPropertyV1::INFO,
ScriptWithExtensionsPropertyV1::INFO,
SegmentStarterV1::INFO,
SentenceTerminalV1::INFO,
SoftDottedV1::INFO,
TerminalPunctuationV1::INFO,
UnifiedIdeographV1::INFO,
UppercaseV1::INFO,
VariationSelectorV1::INFO,
WhiteSpaceV1::INFO,
XdigitV1::INFO,
XidContinueV1::INFO,
XidStartV1::INFO,
BidiClassNameToValueV2::INFO,
BidiClassV1::INFO,
BidiClassValueToLongNameV1::INFO,
BidiClassValueToShortNameV1::INFO,
CanonicalCombiningClassNameToValueV2::INFO,
CanonicalCombiningClassV1::INFO,
CanonicalCombiningClassValueToLongNameV1::INFO,
CanonicalCombiningClassValueToShortNameV1::INFO,
EastAsianWidthNameToValueV2::INFO,
EastAsianWidthV1::INFO,
EastAsianWidthValueToLongNameV1::INFO,
EastAsianWidthValueToShortNameV1::INFO,
GeneralCategoryMaskNameToValueV2::INFO,
GeneralCategoryNameToValueV2::INFO,
GeneralCategoryV1::INFO,
GeneralCategoryValueToLongNameV1::INFO,
GeneralCategoryValueToShortNameV1::INFO,
GraphemeClusterBreakNameToValueV2::INFO,
GraphemeClusterBreakV1::INFO,
GraphemeClusterBreakValueToLongNameV1::INFO,
GraphemeClusterBreakValueToShortNameV1::INFO,
HangulSyllableTypeNameToValueV2::INFO,
HangulSyllableTypeV1::INFO,
HangulSyllableTypeValueToLongNameV1::INFO,
HangulSyllableTypeValueToShortNameV1::INFO,
IndicSyllabicCategoryNameToValueV2::INFO,
IndicSyllabicCategoryV1::INFO,
IndicSyllabicCategoryValueToLongNameV1::INFO,
IndicSyllabicCategoryValueToShortNameV1::INFO,
JoiningTypeNameToValueV2::INFO,
JoiningTypeV1::INFO,
JoiningTypeValueToLongNameV1::INFO,
JoiningTypeValueToShortNameV1::INFO,
LineBreakNameToValueV2::INFO,
LineBreakV1::INFO,
LineBreakValueToLongNameV1::INFO,
LineBreakValueToShortNameV1::INFO,
ScriptNameToValueV2::INFO,
ScriptV1::INFO,
ScriptValueToLongNameV1::INFO,
ScriptValueToShortNameV1::INFO,
SentenceBreakNameToValueV2::INFO,
SentenceBreakV1::INFO,
SentenceBreakValueToLongNameV1::INFO,
SentenceBreakValueToShortNameV1::INFO,
WordBreakNameToValueV2::INFO,
WordBreakV1::INFO,
WordBreakValueToLongNameV1::INFO,
WordBreakValueToShortNameV1::INFO,
];
#[derive(Debug, Eq, PartialEq, Clone, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_properties::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[non_exhaustive]
pub enum PropertyCodePointSet<'data> {
InversionList(#[cfg_attr(feature = "serde", serde(borrow))] CodePointInversionList<'data>),
}
icu_provider::data_struct!(
PropertyCodePointSet<'_>,
#[cfg(feature = "datagen")]
);
impl<'data> PropertyCodePointSet<'data> {
#[inline]
pub(crate) fn contains(&self, ch: char) -> bool {
match *self {
Self::InversionList(ref l) => l.contains(ch),
}
}
#[inline]
pub(crate) fn contains32(&self, ch: u32) -> bool {
match *self {
Self::InversionList(ref l) => l.contains32(ch),
}
}
#[inline]
pub(crate) fn iter_ranges(&self) -> impl Iterator<Item = RangeInclusive<u32>> + '_ {
match *self {
Self::InversionList(ref l) => l.iter_ranges(),
}
}
#[inline]
pub(crate) fn iter_ranges_complemented(
&self,
) -> impl Iterator<Item = RangeInclusive<u32>> + '_ {
match *self {
Self::InversionList(ref l) => l.iter_ranges_complemented(),
}
}
#[inline]
pub(crate) fn from_code_point_inversion_list(l: CodePointInversionList<'static>) -> Self {
Self::InversionList(l)
}
#[inline]
pub(crate) fn as_code_point_inversion_list(
&'_ self,
) -> Option<&'_ CodePointInversionList<'data>> {
match *self {
Self::InversionList(ref l) => Some(l),
}
}
#[inline]
pub(crate) fn to_code_point_inversion_list(&self) -> CodePointInversionList<'_> {
match *self {
Self::InversionList(ref t) => ZeroFrom::zero_from(t),
}
}
}
#[derive(Clone, Debug, Eq, PartialEq, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_properties::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[non_exhaustive]
pub enum PropertyCodePointMap<'data, T: TrieValue> {
CodePointTrie(#[cfg_attr(feature = "serde", serde(borrow))] CodePointTrie<'data, T>),
}
icu_provider::data_struct!(
<T: TrieValue> PropertyCodePointMap<'_, T>,
#[cfg(feature = "datagen")]
);
impl<'data, T: TrieValue> PropertyCodePointMap<'data, T> {
#[inline]
pub(crate) fn get32(&self, ch: u32) -> T {
match *self {
Self::CodePointTrie(ref t) => t.get32(ch),
}
}
#[inline]
#[cfg(feature = "alloc")]
pub(crate) fn try_into_converted<P>(
self,
) -> Result<PropertyCodePointMap<'data, P>, zerovec::ule::UleError>
where
P: TrieValue,
{
match self {
Self::CodePointTrie(t) => t
.try_into_converted()
.map(PropertyCodePointMap::CodePointTrie),
}
}
#[inline]
#[cfg(feature = "alloc")]
pub(crate) fn get_set_for_value(&self, value: T) -> CodePointInversionList<'static> {
match *self {
Self::CodePointTrie(ref t) => t.get_set_for_value(value),
}
}
#[inline]
pub(crate) fn iter_ranges(&self) -> impl Iterator<Item = CodePointMapRange<T>> + '_ {
match *self {
Self::CodePointTrie(ref t) => t.iter_ranges(),
}
}
#[inline]
pub(crate) fn iter_ranges_mapped<'a, U: Eq + 'a>(
&'a self,
map: impl FnMut(T) -> U + Copy + 'a,
) -> impl Iterator<Item = CodePointMapRange<U>> + 'a {
match *self {
Self::CodePointTrie(ref t) => t.iter_ranges_mapped(map),
}
}
#[inline]
pub(crate) fn from_code_point_trie(trie: CodePointTrie<'static, T>) -> Self {
Self::CodePointTrie(trie)
}
#[inline]
pub(crate) fn as_code_point_trie(&self) -> Option<&CodePointTrie<'data, T>> {
match *self {
Self::CodePointTrie(ref t) => Some(t),
}
}
#[inline]
pub(crate) fn to_code_point_trie(&self) -> CodePointTrie<'_, T> {
match *self {
Self::CodePointTrie(ref t) => ZeroFrom::zero_from(t),
}
}
}
#[derive(Debug, Eq, PartialEq, Clone, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_properties::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[non_exhaustive]
pub enum PropertyUnicodeSet<'data> {
CPInversionListStrList(
#[cfg_attr(feature = "serde", serde(borrow))] CodePointInversionListAndStringList<'data>,
),
}
icu_provider::data_struct!(
PropertyUnicodeSet<'_>,
#[cfg(feature = "datagen")]
);
impl<'data> PropertyUnicodeSet<'data> {
#[inline]
pub(crate) fn contains_str(&self, s: &str) -> bool {
match *self {
Self::CPInversionListStrList(ref l) => l.contains_str(s),
}
}
#[inline]
pub(crate) fn contains32(&self, cp: u32) -> bool {
match *self {
Self::CPInversionListStrList(ref l) => l.contains32(cp),
}
}
#[inline]
pub(crate) fn contains(&self, ch: char) -> bool {
match *self {
Self::CPInversionListStrList(ref l) => l.contains(ch),
}
}
#[inline]
pub(crate) fn from_code_point_inversion_list_string_list(
l: CodePointInversionListAndStringList<'static>,
) -> Self {
Self::CPInversionListStrList(l)
}
#[inline]
pub(crate) fn as_code_point_inversion_list_string_list(
&'_ self,
) -> Option<&'_ CodePointInversionListAndStringList<'data>> {
match *self {
Self::CPInversionListStrList(ref l) => Some(l),
}
}
#[inline]
pub(crate) fn to_code_point_inversion_list_string_list(
&self,
) -> CodePointInversionListAndStringList<'_> {
match *self {
Self::CPInversionListStrList(ref t) => ZeroFrom::zero_from(t),
}
}
}
#[derive(Debug, Eq, PartialEq, Clone, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_properties::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct ScriptWithExtensionsProperty<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, ScriptWithExt>,
#[cfg_attr(feature = "serde", serde(borrow))]
pub extensions: VarZeroVec<'data, ZeroSlice<Script>>,
}
icu_provider::data_struct!(
ScriptWithExtensionsProperty<'_>,
#[cfg(feature = "datagen")]
);