1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibUnicode: Parse locale extensions of the Unicode locale extension form

This commit is contained in:
Timothy Flynn 2021-08-27 16:38:06 -04:00 committed by Linus Groh
parent dd89901b07
commit eda92d15e4
3 changed files with 192 additions and 4 deletions

View file

@ -9,6 +9,7 @@
#include <AK/Optional.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <AK/Variant.h>
#include <AK/Vector.h>
#include <LibUnicode/Forward.h>
@ -22,8 +23,21 @@ struct LanguageID {
Vector<StringView> variants {};
};
struct Keyword {
StringView key {};
Vector<StringView> types {};
};
struct LocaleExtension {
Vector<StringView> attributes {};
Vector<Keyword> keywords {};
};
using Extension = Variant<LocaleExtension>;
struct LocaleID {
LanguageID language_id {};
Vector<Extension> extensions {};
};
// Note: These methods only verify that the provided strings match the EBNF grammar of the