diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h index ccc1da61f0b..89556aaf60e 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h @@ -7,39 +7,14 @@ #pragma once #include -#include -#include #include -#include #include #include #include #include #include -#include #include #include -#include - -template -concept IntegralOrEnum = Integral || Enum; - -template -struct AK::Traits> : public DefaultTraits> { - static unsigned hash(Vector const& list) - { - auto hash = int_hash(static_cast(list.size())); - - for (auto value : list) { - if constexpr (Enum) - hash = pair_int_hash(hash, to_underlying(value)); - else - hash = pair_int_hash(hash, value); - } - - return hash; - } -}; template class UniqueStorage { @@ -422,33 +397,3 @@ static constexpr Array, @size@> @name@ { { } }; )~~~"); } - -inline Vector parse_code_point_list(StringView list) -{ - Vector code_points; - - auto segments = list.split_view(' '); - for (auto const& code_point : segments) - code_points.append(AK::StringUtils::convert_to_uint_from_hex(code_point).value()); - - return code_points; -} - -inline Unicode::CodePointRange parse_code_point_range(StringView list) -{ - Unicode::CodePointRange code_point_range {}; - - if (list.contains(".."sv)) { - auto segments = list.split_view(".."sv); - VERIFY(segments.size() == 2); - - auto begin = AK::StringUtils::convert_to_uint_from_hex(segments[0]).value(); - auto end = AK::StringUtils::convert_to_uint_from_hex(segments[1]).value(); - code_point_range = { begin, end }; - } else { - auto code_point = AK::StringUtils::convert_to_uint_from_hex(list).value(); - code_point_range = { code_point, code_point }; - } - - return code_point_range; -} diff --git a/Userland/Libraries/LibUnicode/CharacterTypes.h b/Userland/Libraries/LibUnicode/CharacterTypes.h index 6521918b46d..4d9a669ae5d 100644 --- a/Userland/Libraries/LibUnicode/CharacterTypes.h +++ b/Userland/Libraries/LibUnicode/CharacterTypes.h @@ -14,18 +14,6 @@ namespace Unicode { -struct CodePointRange { - u32 first { 0 }; - u32 last { 0 }; -}; - -struct CodePointRangeComparator { - constexpr int operator()(u32 code_point, CodePointRange const& range) - { - return (code_point > range.last) - (code_point < range.first); - } -}; - Optional general_category_from_string(StringView); bool code_point_has_general_category(u32 code_point, GeneralCategory general_category);