AK: Replace wchar_t formatting with char32_t
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This makes TestFormat fully cross-platform as we no longer have to
work around the 16 vs 32-bit wide strings
This commit is contained in:
Ashton 2025-05-18 16:05:41 -07:00 committed by Andrew Kaster
commit 5f5ae6bf8b
Notes: github-actions[bot] 2025-05-19 01:19:15 +00:00
3 changed files with 15 additions and 14 deletions

View file

@ -984,11 +984,11 @@ ErrorOr<void> Formatter<char>::format(FormatBuilder& builder, char value)
return formatter.format(builder, { &value, 1 });
}
}
ErrorOr<void> Formatter<wchar_t>::format(FormatBuilder& builder, wchar_t value)
ErrorOr<void> Formatter<char32_t>::format(FormatBuilder& builder, char32_t value)
{
if (m_mode == Mode::Binary || m_mode == Mode::BinaryUppercase || m_mode == Mode::Decimal || m_mode == Mode::Octal || m_mode == Mode::Hexadecimal || m_mode == Mode::HexadecimalUppercase) {
Formatter<u32> formatter { *this };
return formatter.format(builder, static_cast<u32>(value));
return formatter.format(builder, value);
} else {
StringBuilder codepoint;
codepoint.append_code_point(value);