mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-10 21:22:53 +00:00
LibUnicode: Move GenerateUnicodeData's Alias struct to generator header
This will be used for locale aliases as well. Also rename the "property" field in this struct to "name", as it no longer is only used for property aliases.
This commit is contained in:
parent
186e1b7624
commit
9d1519e21c
Notes:
sideshowbarker
2024-07-18 01:00:17 +09:00
Author: https://github.com/trflynn89
Commit: 9d1519e21c
Pull-request: https://github.com/SerenityOS/serenity/pull/10947
2 changed files with 7 additions and 8 deletions
|
@ -45,12 +45,6 @@ struct SpecialCasing {
|
|||
// Property descriptions: https://www.unicode.org/reports/tr44/tr44-13.html#PropList.txt
|
||||
using PropList = HashMap<String, Vector<CodePointRange>>;
|
||||
|
||||
// PropertyAliases source: https://www.unicode.org/Public/13.0.0/ucd/PropertyAliases.txt
|
||||
struct Alias {
|
||||
String property;
|
||||
String alias;
|
||||
};
|
||||
|
||||
// Normalization source: https://www.unicode.org/Public/13.0.0/ucd/DerivedNormalizationProps.txt
|
||||
// Normalization descriptions: https://www.unicode.org/reports/tr44/#DerivedNormalizationProps.txt
|
||||
enum class QuickCheck {
|
||||
|
@ -479,7 +473,7 @@ enum class @name@ : @underlying@ {)~~~");
|
|||
|
||||
for (auto const& alias : aliases) {
|
||||
generator.set("alias", alias.alias);
|
||||
generator.set("value", alias.property);
|
||||
generator.set("value", alias.name);
|
||||
generator.append(R"~~~(
|
||||
@alias@ = @value@,)~~~");
|
||||
}
|
||||
|
@ -929,7 +923,7 @@ static void normalize_script_extensions(PropList& script_extensions, PropList co
|
|||
|
||||
for (auto const& extension : extensions) {
|
||||
auto it = find_if(script_aliases.begin(), script_aliases.end(), [&](auto const& alias) { return extension.key == alias.alias; });
|
||||
auto const& key = (it == script_aliases.end()) ? extension.key : it->property;
|
||||
auto const& key = (it == script_aliases.end()) ? extension.key : it->name;
|
||||
|
||||
auto& code_points = script_extensions.find(key)->value;
|
||||
code_points.extend(extension.value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue