summaryrefslogtreecommitdiff
path: root/Meta
AgeCommit message (Collapse)Author
2021-12-01LibUnicode: Do not generate data for "generic" calendarsTimothy Flynn
This is not a calendar supported by ECMA-402, so let's not waste space with its data. Further, don't generate "gregorian" as a valid Unicode locale extension keyword. It's an invalid type identifier, thus cannot be used in locales such as "en-u-ca-gregorian".
2021-11-30LibUnicode: Support code point names that apply to ranges of code pointsTimothy Flynn
For example, consider the following adjacent entries in UnicodeData.txt: 3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;; 4DBF;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;; Our current implementation would assign the display name "CJK Ideograph Extension A" to code points U+3400 & U+4DBF, but not to the code points in between. Not only should those code points be assigned a name, but the Unicode spec also has formatting rules on what the names should be (the names for these ranged code points are not as they appear in UnicodeData.txt). The spec also defines names for code point ranges that actually are listed individually in UnicodeData.txt. For example: 2F800;CJK COMPATIBILITY IDEOGRAPH-2F800;Lo;0;L;4E3D;;;;N;;;;; 2F801;CJK COMPATIBILITY IDEOGRAPH-2F801;Lo;0;L;4E38;;;;N;;;;; 2F802;CJK COMPATIBILITY IDEOGRAPH-2F802;Lo;0;L;4E41;;;;N;;;;; Code points are only coalesced into a range if all fields after the name are equivalent. Our parser will insert the range and its name formatting pattern when it comes across the first code point in that range, then ignore other code points in that range. This reduces the number of names we generated by nearly 2,000.
2021-11-30LibUnicode: Remove unused field from UnicodeData generatorTimothy Flynn
2021-11-29LibUnicode: Parse and generate calendar (ca) Unicode keywordsTimothy Flynn
Also removes a few fly-by "StringView x = nullptr;" unnecessary initializers.
2021-11-29LibUnicode: Parse and generate regional hour cyclesTimothy Flynn
Unlike most data in the CLDR, hour cycles are not stored on a per-locale basis. Instead, they are keyed by a string that is usually a region, but sometimes is a locale. Therefore, given a locale, to determine the hour cycles for that locale, we: 1. Check if the locale itself is assigned hour cycles. 2. If the locale has a region, check if that region is assigned hour cycles. 3. Otherwise, maximize that locale, and if the maximized locale has a region, check if that region is assigned hour cycles. 4. If the above all fail, fallback to the "001" region. Further, each locale's default hour cycle is the first assigned hour cycle.
2021-11-29LibUnicode: Sort generated enums case-insensitivelyTimothy Flynn
This hasn't mattered yet by chance, because the source for all enums contains names of the same case. But the enum generated for hour cycle regions will have mixed case. Sort them case-insensitively in order to traverse these names in the same order in both generate_enum and generate_mapping.
2021-11-29LibUnicode: Parse and generate available candidate format patternsTimothy Flynn
These formats are used by ECMA-402 when neither a date nor time style is specified. In that case, these patterns are searched for a best match.
2021-11-29LibUnicode: Hard-code an alias from the Gregorian calendar to GregoryTimothy Flynn
This alias exists because the name "Gregorian" is too long to be used in a locale identifier, i.e. "en-u-ca-gregorian" is invalid. Aliases for calendars are defined here: https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-bcp47/bcp47/calendar.json However, CLDR version 40 neglected to actually include the cldr-bcp47 package in its release, so we don't have access to this data. So for now hard-code this alias so that JavaScript can actually access it. See: https://unicode-org.atlassian.net/browse/CLDR-15158
2021-11-29LibUnicode: Parse and generate date, time, and date-time format patternsTimothy Flynn
2021-11-29LibUnicode: Create a nearly empty generator for date-time formattingTimothy Flynn
Similar to number formatting, the data for date-time formatting will be located in its own generated file. This extracts the cldr-dates package from the CLDR and sets up the generator plumbing to create the date-time data files.
2021-11-29LibJS+LibUnicode: Separate number formatting methods from Locale.hTimothy Flynn
Currently, we generate separate data files for locale and number format related tables/methods, but provide public accessors for all of the data in one Locale.h file. Rather than continuing this trend for date-time, relative time, etc. formatting, it's a bit easier to reason about if the public accessors are also in separate files.
2021-11-29Tests: Add a simple LibGL render-testHendiadyoin1
At the moment we just check if we *can* render a simple triangle, we do not yet actually test if the image is indeed the triangle we wanted. This test also outputs the rendered image when GL_DEBUG is enabled to a file called "picture.bmp" for manual verification. Co-authored-by: sunverwerth <s.unverwerth@serenityos.org>
2021-11-29Lagom: Add LibGL to the librariesHendiadyoin1
2021-11-29Lagom: Disable implicit-const-int-float-conversion warningsHendiadyoin1
2021-11-28LibIPC+IPCCompiler+AK: Make IPC value decoders return ErrorOr<void>Andreas Kling
This allows us to use TRY() in decoding helpers, leading to a nice reduction in line count.
2021-11-28LibIPC: Make IPC::Connection::post_message() return ErrorOrAndreas Kling
2021-11-28LibAudio: New error propagation API in Loader and Bufferkleines Filmröllchen
Previously, a libc-like out-of-line error information was used in the loader and its plugins. Now, all functions that may fail to do their job return some sort of Result. The universally-used error type ist the new LoaderError, which can contain information about the general error category (such as file format, I/O, unimplemented features), an error description, and location information, such as file index or sample index. Additionally, the loader plugins try to do as little work as possible in their constructors. Right after being constructed, a user should call initialize() and check the errors returned from there. (This is done transparently by Loader itself.) If a constructor caused an error, the call to initialize should check and return it immediately. This opportunity was used to rework a lot of the internal error propagation in both loader classes, especially FlacLoader. Therefore, a couple of other refactorings may have sneaked in as well. The adoption of LibAudio users is minimal. Piano's adoption is not important, as the code will receive major refactoring in the near future anyways. SoundPlayer's adoption is also less important, as changes to refactor it are in the works as well. aplay's adoption is the best and may serve as an example for other users. It also includes new buffering behavior. Buffer also gets some attention, making it OOM-safe and thereby also propagating its errors to the user.
2021-11-28Meta: Allow overlong 'fixup!' commit titles in pre-commit hookBen Wiederhake
2021-11-28Meta: Copy libstdc++ into the disk imageDaniel Bertalan
With this, we can now compile C++ programs with the LLVM port without having to jump through hooks to build libc++ because it can't be cross-compiled with our GNU toolchain.
2021-11-28Meta: Copy libc++ headers into the disk imageDaniel Bertalan
If we do this, the LLVM port's Clang will pick up these paths, so we won't have to compile libc++ twice. This does increase the size of _disk_image by 5 MB, but that shouldn't be a problem.
2021-11-28Kernel: Add AC97_DEBUG macroJelle Raaijmakers
2021-11-26CMake: Also install the source files of userland programsItamar
Previously, we only copied the source files of libraries to `/usr/src/serenity`. We now also install the source files of userland programs.
2021-11-26CMake: Simplify serenity_install_sources by inferring installation pathItamar
The serenity_install_sources function now infers the path under `/usr/src/serenity` in which to install the source files according to the relative path of the source files in the repository. For example `Userland/Libraries/LibGUI/Widget.h` gets installed at `/usr/src/serenity/Userland/Libraries/LibGUI/Widget.h`. This fixes cases where the source files of libraries are not under `Userland/Libraries` (for example LibShell & LibLanguageServer).
2021-11-23LibUnicode: Port generator utility methods to ErrorOrTimothy Flynn
Most of these were VERIFY-ing for success, but propagating an error message up to serenity_main() is much nicer than just a SIGABRT.
2021-11-23LibUnicode: Port GenerateUnicodeNumberFormat to ErrorOr and LibMainTimothy Flynn
2021-11-23LibUnicode: Port GenerateUnicodeLocale to ErrorOr and LibMainTimothy Flynn
2021-11-23LibUnicode: Port GenerateUnicodeData to ErrorOr and LibMainTimothy Flynn
Also store command line arguments as StringViews rather than pointers.
2021-11-23Meta: Allow lagom_tool invocations to specify libraries to linkTimothy Flynn
2021-11-23Meta: Define LagomMain outside of the BUILD_LAGOM branchTimothy Flynn
This allows code generators to use LagomMain. Otherwise, during CI, they are built during the superbuild without BUILD_LAGOM=ON.
2021-11-23LibUnicode: Functionalize the Unicode generator CMake commandsTimothy Flynn
Makes it a bit easier to add a new generator.
2021-11-23LibUnicode: Invoke lagom_tool() with SOURCES inlineTimothy Flynn
2021-11-23Meta: Increase PulseAudio timer period to 2msJelle Raaijmakers
This seems to prevent crackling audio when starting up Qemu whenever there is audio already playing.
2021-11-23Meta: Use 1ms timer period for Qemu Pulse Audio backendJelle Raaijmakers
The default seems to be 10ms and can result in a lot of crackling noises in the output. A value of 1ms works well on my machine.
2021-11-23Meta: Use AC97 device in Qemu by defaultJelle Raaijmakers
2021-11-22js: Port to LibMain :^)Linus Groh
This wasn't particularly difficult, and there's not much use for the nicer interface yet either. While unveil() is of limited use in js(1) as it should be able to open arbitrary files, I feel like we should be able to add a pledge() call.
2021-11-22Lagom: Add LibMain as a lagom_lib()Linus Groh
2021-11-21LibGfx: Make ImageDecoderPlugin::frame() return ErrorOr<>Andreas Kling
This is a first step towards better error propagation from image codecs.
2021-11-20Meta+LibUnicode: Provide code point names through libraryBen Wiederhake
2021-11-19LibUnicode: Support locales-without-script aliases for ECMA-402Timothy Flynn
As noted by ECMA-402, if a supported locale contains all of a language, script, and region subtag, then the implementation must also support the locale without the script subtag. The most complicated example of this is the zh-TW locale. The list of locales in the CLDR database does not include zh-TW or its maximized zh-Hant-TW variant. Instead, it inlcudes the zh-Hant locale. However, zh-Hant-TW is listed in the default-content locale list in the cldr-core package. This defines an alias from zh-Hant-TW to zh-Hant. We must then also support the zh-Hant-TW alias without the script subtag: zh-TW. This transitively maps zh-TW to zh-Hant, which is a case quite heavily tested by test262.
2021-11-19LibUnicode: Stop passing the cldr-core package to UnicodeNumberFormatTimothy Flynn
This is no longer needed now that this generator isn't parsing the default-content locales.
2021-11-19LibUnicode: Generate default-content locales as aliasesTimothy Flynn
Previously, we were just copying the locale data into default-content locales (for example, copying the "en" data into "en-US"). Instead, we can just define the default-content locales as aliases to their main locales.
2021-11-19LibUnicode: Move GenerateUnicodeData's Alias struct to generator headerTimothy Flynn
This will be used for locale aliases as well. Also rename the "property" field in this struct to "name", as it no longer is only used for property aliases.
2021-11-18LibGfx: Remove ImageDecoderPlugin::bitmap() in favor of frame(index)Andreas Kling
To encourage proper support for multi-frame images throughout the system, get rid of the single-frame convenience bitmap() API.
2021-11-18Fuzzers: Use ImageDecoderPlugin::frame() in image decoder fuzzersAndreas Kling
Let's work towards getting rid of the first-frame-only bitmap() API.
2021-11-17AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional)Andreas Kling
Also add slightly richer parse errors now that we can include a string literal with returned errors. This will allow us to use TRY() when working with JSON data.
2021-11-16LibUnicode: Parse and generate CLDR unit data for Intl.NumberFormatTimothy Flynn
The units data is in another CLDR package, cldr-units.
2021-11-16LibUnicode: Ignore U+200F when parsing format identifiersTimothy Flynn
Noticed this while implementing multiple identifier support. We were errantly parsing U+200F as a lone identifier in some Hebrew formats.
2021-11-16LibJS+LibUnicode: Support multiple identifiers within format patternTimothy Flynn
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}".
2021-11-16LibJS+LibUnicode: Rename the generated compact_identifier to identifierTimothy Flynn
This field is currently used to store the StringView into the compact name/symbol in the format string. Units will need to store a similar field, so rename the field to be more generic, and extract the parser for it.
2021-11-16LibJS+LibUnicode: Fix computation of compact pattern exponentsTimothy Flynn
The compact scale of each formatting rule was precomputed in commit: be69eae651abf0cc3e9cd0906f9586fdfbfb68ef Using the formula: compact scale = magnitude - pattern scale This computation was off-by-one. For example, consider the format key "10000-count-one", which maps to "00 thousand" in en-US. What we are really after is the exponent that best represents the string "thousand" for values greater than 10000 and less than 100000 (the next format key). We were previously doing: log10(10000) - "00 thousand".count("0") = 2 Which clearly isn't what we want. Instead, if we do: log10(10000) + 1 - "00 thousand".count("0") = 3 We get the correct exponent for each format key for each locale. This commit also renames the generated variable from "compact_scale" to "exponent" to match the terminology used in ECMA-402.