LibUnicode: Remove now-unused code generator facilities
This commit is contained in:
parent
069bed5d47
commit
2ba7b4c529
Notes:
sideshowbarker
2024-07-17 07:43:05 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/2ba7b4c529 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/239
2 changed files with 0 additions and 67 deletions
Meta/Lagom/Tools/CodeGenerators/LibUnicode
Userland/Libraries/LibUnicode
|
@ -7,39 +7,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashFunctions.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/NumericLimits.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/QuickSort.h>
|
||||
#include <AK/SourceGenerator.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Traits.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibUnicode/CharacterTypes.h>
|
||||
|
||||
template<typename T>
|
||||
concept IntegralOrEnum = Integral<T> || Enum<T>;
|
||||
|
||||
template<IntegralOrEnum T>
|
||||
struct AK::Traits<Vector<T>> : public DefaultTraits<Vector<T>> {
|
||||
static unsigned hash(Vector<T> const& list)
|
||||
{
|
||||
auto hash = int_hash(static_cast<u32>(list.size()));
|
||||
|
||||
for (auto value : list) {
|
||||
if constexpr (Enum<T>)
|
||||
hash = pair_int_hash(hash, to_underlying(value));
|
||||
else
|
||||
hash = pair_int_hash(hash, value);
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename StorageType>
|
||||
class UniqueStorage {
|
||||
|
@ -422,33 +397,3 @@ static constexpr Array<ReadonlySpan<@type@>, @size@> @name@ { {
|
|||
} };
|
||||
)~~~");
|
||||
}
|
||||
|
||||
inline Vector<u32> parse_code_point_list(StringView list)
|
||||
{
|
||||
Vector<u32> code_points;
|
||||
|
||||
auto segments = list.split_view(' ');
|
||||
for (auto const& code_point : segments)
|
||||
code_points.append(AK::StringUtils::convert_to_uint_from_hex<u32>(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<u32>(segments[0]).value();
|
||||
auto end = AK::StringUtils::convert_to_uint_from_hex<u32>(segments[1]).value();
|
||||
code_point_range = { begin, end };
|
||||
} else {
|
||||
auto code_point = AK::StringUtils::convert_to_uint_from_hex<u32>(list).value();
|
||||
code_point_range = { code_point, code_point };
|
||||
}
|
||||
|
||||
return code_point_range;
|
||||
}
|
||||
|
|
|
@ -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<GeneralCategory> general_category_from_string(StringView);
|
||||
bool code_point_has_general_category(u32 code_point, GeneralCategory general_category);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue