[webkit-changes] [WebKit/WebKit] 04372f: [WGSL] Should be able to parse hex and decimals wh...
Tadeu Zagallo
noreply at github.com
Fri Jan 26 08:23:48 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 04372fb7b43abb1dde761c9250e079ec47461801
https://github.com/WebKit/WebKit/commit/04372fb7b43abb1dde761c9250e079ec47461801
Author: Tadeu Zagallo <tzagallo at apple.com>
Date: 2024-01-26 (Fri, 26 Jan 2024)
Changed paths:
M Source/WebGPU/WGSL/Lexer.cpp
A Source/WebGPU/WGSL/tests/valid/constants-utf16.wgsl
Log Message:
-----------
[WGSL] Should be able to parse hex and decimals when using 16-bit chars
https://bugs.webkit.org/show_bug.cgi?id=268087
rdar://121604575
Reviewed by Mike Wyrzykowski.
We use `std::from_chars` to parse hex and decimals numbers, which only works with
char*. Since the digits should be ascii in either case, and the maximum length is
is only 19, we just copy it into a char[20] buffer and continue using `std::from_chars`.
* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<T>::lexNumber):
* Source/WebGPU/WGSL/tests/valid/constants-utf16.wgsl: Added.
Canonical link: https://commits.webkit.org/273564@main
More information about the webkit-changes
mailing list