summaryrefslogtreecommitdiff
path: root/Meta
AgeCommit message (Collapse)Author
2021-11-14LibUnicode: Parse and generate scientific formatting rulesTimothy Flynn
2021-11-14LibUnicode: Fix typo in percent format parserTimothy Flynn
Just by sheer luck this had no actual effect because the decimal format prefix has the same length as the percent format prefix.
2021-11-14LibUnicode: Generate primary and secondary number grouping sizesTimothy Flynn
Most locales have a single grouping size (the number of integer digits to be written before inserting a grouping separator). However some have a primary and secondary size. We parse the primary size as the size used for the least significant integer digits, and the secondary size for the most significant.
2021-11-13LibJS+LibUnicode: Don't remove {currency} keys in GetNumberFormatPatternTimothy Flynn
In order to implement Intl.NumberFormat.prototype.formatToParts, do not replace {currency} keys in the format pattern before ECMA-402 tells us to. Otherwise, the array return by formatToParts will not contain the expected currency key. Early replacement was done to avoid resolving the currency display more than once, as it involves a couple of round trips to search through LibUnicode data. So this adds a non-standard method to NumberFormat to do this resolution and cache the result. Another side effect of this change is that LibUnicode must replace unit format patterns of the form "{0} {1}" during code generation. These were previously skipped during code generation because LibJS would just replace the keys with the currency display at runtime. But now that the currency display injection is delayed, any {0} or {1} keys in the format pattern will cause PartitionNumberPattern to abort.
2021-11-13LibJS+LibUnicode: Fully implement currency number formattingTimothy Flynn
Currencies are a bit strange; the layout of currency data in the CLDR is not particularly compatible with what ECMA-402 expects. For example, the currency format in the "en" and "ar" locales for the Latin script are: en: "¤#,##0.00" ar: "¤\u00A0#,##0.00" Note how the "ar" locale has a non-breaking space after the currency symbol (¤), but "en" does not. This does not mean that this space will appear in the "ar"-formatted string, nor does it mean that a space won't appear in the "en"-formatted string. This is a runtime decision based on the currency display chosen by the user ("$" vs. "USD" vs. "US dollar") and other rules in the Unicode TR-35 spec. ECMA-402 shies away from the nuances here with "implementation-defined" steps. LibUnicode will store the data parsed from the CLDR however it is presented; making decisions about spacing, etc. will occur at runtime based on user input.
2021-11-13LibUnicode: Ensure UnicodeNumberFormat is aware of default contentTimothy Flynn
For example, there isn't a unique set of data for the en-US locale; rather, it defaults to the data for the en locale. See this commit for much more detail: 357c97dfa864dbd779d517bac502858aa2618b96
2021-11-13LibUnicode: Generate currency unit-pattern number formatsTimothy Flynn
These are used when formatting a number as currency with a display option of "name" (e.g. for USD, the name is "US Dollars" in en-US). These patterns appear in the CLDR in a different manner than other number formats that are pluralized. They are of the form "{0} {1}", therefore do not undergo subpattern replacements.
2021-11-13LibJS+LibUnicode: Generate all styles of currency localizationsTimothy Flynn
Currently, LibUnicode is only parsing and generating the "long" style of currency display names. However, the CLDR contains "short" and "narrow" forms as well that need to be handled. Parse these, and update LibJS to actually respect the "style" option provided by the user for displaying currencies with Intl.DisplayNames. Note: There are some discrepencies between the engines on how style is handled. In particular, running: new Intl.DisplayNames('en', {type:'currency', style:'narrow'}).of('usd') Gives: SpiderMoney: "USD" V8: "US Dollar" LibJS: "$" And running: new Intl.DisplayNames('en', {type:'currency', style:'short'}).of('usd') Gives: SpiderMonkey: "$" V8: "US Dollar" LibJS: "$" My best guess is V8 isn't handling style, and just returning the long form (which is what LibJS did before this commit). And SpiderMoney can handle some styles, but if they don't have a value for the requested style, they fall back to the canonicalized code passed into of().
2021-11-13LibUnicode: Parse numbers in number formats a bit more lenientlyTimothy Flynn
The parser was previously expecting number sections within a pattern to start with "#", but they may also begin with "0".
2021-11-13Meta: Resolve cyclic dependency between LibPthread and libc++Daniel Bertalan
libc++ uses a Pthread condition variable in one of its initialization functions. This means that Pthread forwarding has to be set up in LibC before libc++ can be initialized. Also, because LibPthread is written in C++, (at least some) parts of the C++ standard library have to be linked against it. This is a circular dependency, which means that the order in which these two libraries' initialization functions are called is undefined. In some cases, libc++ will come first, which will then trigger an assert due to the missing Pthread forwarding. This issue isn't necessarily unique to LibPthread, as all libraries that libc++ depends on exhibit the same circular dependency issue. The reason why this issue didn't affect the GNU toolchain is that libstdc++ is always linked statically. If we were to change that, I believe that we would run into the same issue.
2021-11-13Fuzzers: Use ImageDecoders instead of load_FORMAT_from_memory() wrappersAndreas Kling
2021-11-12LibUnicode: Move number formatting code generator to UnicodeNumberFormatTimothy Flynn
2021-11-12LibUnicode: Move (soon-to-be) common code out of GenerateUnicodeLocaleTimothy Flynn
The data used for number formatting is going to grow quite a bit when the cldr-units package is parsed. To prevent the generated UnicodeLocale file from growing outrageously large, the number formatting data can go into its own file. To prepare for this, move code that will be common between the generators for UnicodeLocale and UnicodeNumberFormat to the utility header.
2021-11-12Meta: Update the gdb script for the new RefPtr layoutAli Mohammad Pur
2021-11-12LibUnicode: Precompute the compact scale of each number formatting ruleTimothy Flynn
This will be needed for the ComputeExponentForMagnitude AO for compact formatting, namely step 5b: Let exponent be an implementation- and locale-dependent (ILD) integer by which to scale a number of the given magnitude in compact notation for the current locale.
2021-11-12LibUnicode: Parse number formats into zero/positive/negative patternsTimothy Flynn
A number formatting pattern in the CLDR contains one or two entries, delimited by a semi-colon. Previously, LibUnicode was just storing the entire pattern as one string. This changes the generator to split the pattern on that delimiter and generate the 3 unique patterns expected by ECMA-402. The rules for generating the 3 patterns are as follows: * If the pattern contains 1 entry, it is the zero pattern. The positive pattern is the zero pattern prepended with {plusSign}. The negative pattern is the zero pattern prepended with {minusSign}. * If the pattern contains 2 entries, the first is the zero pattern, and the second is the negative pattern. The positive pattern is the zero pattern prepended with {plusSign}.
2021-11-12LibUnicode: Parse and generate standard accounting formatting rulesTimothy Flynn
Also known as "currency-accounting" in some CLDR documentation.
2021-11-12LibUnicode: Parse and generate standard currency formatting rulesTimothy Flynn
2021-11-12LibUnicode: Parse and generate standard decimal formatting rulesTimothy Flynn
2021-11-12LibUnicode: Parse and generate standard percentage formatting rulesTimothy Flynn
2021-11-12LibUnicode: Parse and generate compact currency formatting rulesTimothy Flynn
2021-11-12LibUnicode: Parse and generate compact decimal formatting rulesTimothy Flynn
2021-11-12LibUnicode: Begin parsing and generating locale number systemsTimothy Flynn
The number system data in the CLDR contains information on how to format numbers in a locale-dependent manner. Start parsing this data, beginning with numeric symbol strings. For example the symbol NaN maps to "NaN" in the en-US locale, and "非數值" in the zh-Hant locale.
2021-11-12LibUnicode: Parse alternate default numbering systemsTimothy Flynn
Some locales in the CLDR have alternate default numbering systems listed under "defaultNumberingSystem-alt-*", e.g.: "defaultNumberingSystem": "arab", "defaultNumberingSystem-alt-latn": "latn", "otherNumberingSystems": { "native": "arab" }, We were previously only parsing "defaultNumberingSystem" and "otherNumberingSystems". This odd format appears to be an artifact of converting from XML.
2021-11-12LibUnicode: Capitialize generated identifiers in lieu of full title caseTimothy Flynn
This isn't particularly important because this generates code that is quite hidden from outside callers. But when viewing the generated code, it's a bit nicer to read e.g. enum identifiers such as "MinusSign" rather than "Minussign".
2021-11-11LibWasm: Implement module validationAli Mohammad Pur
2021-11-11Meta: Update WebAssembly testsuite branch nameAli Mohammad Pur
The 'master' branch is no longer updated, they've switched to 'main'.
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-11-10LibWeb: Make property_initial_value() return a NonnullRefPtrSam Atkins
The finale! Users can now be sure that the value is valid, which makes things simpler.
2021-11-10LibWeb: Ensure that CSS initial values are always valid :^)Sam Atkins
First off, this verifies that an initial value is always provided in Properties.json for each property. Second, it verifies that parsing that initial value succeeds. This means that a call to `property_initial_value()` will always return a valid StyleValue. :^)
2021-11-10CMake: Build serenity_lib libraries with a custom SONAMETim Schumacher
This allows libraries and binaries to explicitly link against `<library>.so.serenity`, which avoids some confusion if there are other libraries with the same name, such as OpenSSL's `libcrypto`.
2021-11-10CMake: Remove unused serenity_shared_lib functionTim Schumacher
2021-11-10LibWeb: Remove concept of CSS pseudo-propertiesSam Atkins
We don't need them any more, so they're gone. :^)
2021-11-09LibUnicode: Upgrade to CLDR version 40.0.0Timothy Flynn
Release notes: https://github.com/unicode-org/cldr-json/releases/tag/40.0.0
2021-11-09LibUnicode: Parse the CLDR's defaultContent.json locale listTimothy Flynn
This file contains the list of locales which default to their parent locale's values. In the core CLDR dataset, these locales have their own files, but they are empty (except for identity data). For example: https://github.com/unicode-org/cldr/blob/main/common/main/en_US.xml In the JSON export, these files are excluded, so we currently are not recognizing these locales just by iterating the locale files. This is a prerequisite for upgrading to CLDR version 40. One of these default-content locales is the popular "en-US" locale, which defaults to "en" values. We were previously inferring the existence of this locale from the "en-US-POSIX" locale (many implementations, including ours, strip variants such as POSIX). However, v40 removes the "en-US-POSIX" locale entirely, meaning that without this change, we wouldn't know that "en-US" exists (we would default to "en"). For more detail on this and other v40 changes, see: https://cldr.unicode.org/index/downloads/cldr-40#h.nssoo2lq3cba
2021-11-05Meta: Remove useless lint-ipc-ids.sh scriptBen Wiederhake
This script was silently broken in commit 62af6cd4f9637b8937e59832f5af00f4556c496b.
2021-11-05Meta: Run IPC magic number linter during CI and pre-commitBen Wiederhake
2021-11-05Meta: Implement checker for IPC magic number collisionsBen Wiederhake
2021-11-05IPCCompiler: Remove now-unused ability to hardcode magic numberBen Wiederhake
2021-11-02Meta: Add a check to ensure grep -P stays gonethislooksfun
grep -P does not work on macOS, but grep -E does.
2021-11-02Meta: Run find in the current dirthislooksfun
macOS's find requires a leading search scope. Without this change this lint step fails.
2021-11-02Meta: Adhere to latest ScriptCheck standards (SC2268)thislooksfun
2021-11-02Meta: Add special case for macOSthislooksfun
macOS's `find` does not support the '-executable' flag, nor does it support the '-perm /' syntax, but we can make it work with a special case.
2021-11-02Meta: Remove unnecessary -ithislooksfun
Using `xargs -i <cmd> {}` is just doing the default behavior of xargs, but with extra steps that also don't work on macOS.
2021-11-02Meta: Use grep -E/F, not grep -Pthislooksfun
grep -E and -F are POSIX standard, and meets all our matching needs.
2021-11-02ConfigureComponents: Reduce duplicated codeBen Wiederhake
2021-11-02Meta: Don't check for toolchain if serenity.sh target is lagomLinus Groh
This is just silly :^) $ serenity run lagom js WARNING: unknown toolchain 'js'. Defaulting to GNU. Valid values are 'Clang', 'GNU' (default)
2021-11-02LibWeb: Convert is_named_property_exposed_on_object to ThrowCompletionsIdan Horowitz
This is the last usage of old-style exceptions in the WrapperGenerator.
2021-11-01Meta: Check auto-generated manpages for completeness on CIBen Wiederhake
2021-11-01Meta: Add script to generate and export manpagesBen Wiederhake