1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:05:10 +00:00

LibJS+LibUnicode: Generate unique numeric symbol lists

There are 443 number system objects generated, each of which held an
array of number system symbols. Of those 443 arrays, only 39 are unique.

To uniquely store these, this change moves the generated NumericSymbol
enumeration to the public LibUnicode/NumberFormat.h header with a pre-
defined set of symbols that we need. This is to ensure the generated,
unique arrays are created in a known order with known symbols. While it
is unfortunate to no longer discover these symbols at generation time,
it does allow us to ignore unwanted symbols and perform less string-to-
enumeration conversions at lookup time.
This commit is contained in:
Timothy Flynn 2021-12-11 00:37:34 -05:00 committed by Linus Groh
parent 9cc323b0b0
commit 2a7f36b392
5 changed files with 79 additions and 66 deletions

View file

@ -16,7 +16,7 @@
namespace Unicode {
Optional<StringView> get_number_system_symbol([[maybe_unused]] StringView locale, [[maybe_unused]] StringView system, [[maybe_unused]] StringView symbol)
Optional<StringView> get_number_system_symbol([[maybe_unused]] StringView locale, [[maybe_unused]] StringView system, [[maybe_unused]] NumericSymbol symbol)
{
#if ENABLE_UNICODE_DATA
return Detail::get_number_system_symbol(locale, system, symbol);