mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibJS+LibUnicode: Support multiple identifiers within format pattern
This wasn't the case for compact patterns, but unit patterns can contain multiple (up to 2, really) identifiers that must each be recognized by LibJS. Each generated NumberFormat object now stores an array of identifiers parsed. The format pattern itself is encoded with the index into this array for that identifier, e.g. the compact format string "0K" will become "{number}{compactIdentifier:0}".
This commit is contained in:
parent
3b68370212
commit
04b8b87c17
3 changed files with 72 additions and 40 deletions
|
@ -122,7 +122,7 @@ struct NumberFormat {
|
|||
StringView zero_format {};
|
||||
StringView positive_format {};
|
||||
StringView negative_format {};
|
||||
StringView identifier {};
|
||||
Vector<StringView> identifiers {};
|
||||
};
|
||||
|
||||
struct ListPatterns {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue