mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-13 02:16:39 +02:00
The motivation is to have `code_point_has_*_control_general_category()` functions, so that clients don't have to look at `GeneralCategory` values directly and hence don't have to worry about `code_point_has_general_category()` returning an empty Optional. This isn't quite achieved since some code inside LibLocale still uses some of them, but it removes uses in LibGfx and LibJS. This kind of cherry-picks the 2nd commit of LadybirdBrowser/ladybird#239 (aa3a30870b58c47cb37bce1418d7e6bee7af71d9): The Lexer.cpp, RegexByteCode.cpp, CharacterTypes.h, KeyboardEvent.cpp changes are by trflynn. This does not (yet?) pick up the new type for `GeneralCategory`. In the future, we might want to make the generator generate a `GeneralCategoryEnum` type and have the `AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL` in Forward.h, but at the moment that makes things more complicated. (It also means we don't pick up the RegexParser.cpp changes.) Co-authored-by: Tim Flynn <trflynn89@serenityos.org>