Bug 245755
Summary: | [WGSL] Implement hex float parsing | ||
---|---|---|---|
Product: | WebKit | Reporter: | Dan Glastonbury <djg> |
Component: | WebGPU | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | mmaxfield, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Dan Glastonbury
WGSL doesn't support hex float parsing.
With a test, such as:
```
TEST(WGSLConstLiteralTests, AbstractFloatLiteralHex)
{
const ConstLiteralTestCase<double> testCases[] = {
{ "0xa.fp+2"_s, 0xa.fp+2 },
{ "0X.3"_s, 0X.3p+0 },
{ "0X1.fp-4"_s, 0X1.fp-4 }
};
for (const auto& testCase : testCases) {
auto parseResult = parseLCharPrimaryExpression(testCase.input);
EXPECT_TRUE(parseResult);
auto expr = WTFMove(*parseResult);
EXPECT_TRUE(expr->isAbstractFloatLiteral());
const auto& floatLiteral = downcast<WGSL::AST::AbstractFloatLiteral>(expr.get());
EXPECT_EQ(floatLiteral.value(), testCase.expectedValue);
auto inputLength = testCase.input.length();
EXPECT_EQ(floatLiteral.span(), WGSL::SourceSpan(0, inputLength, inputLength, 0));
}
}
```
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/100479770>