| Summary: | [WGSL] The lexer should use the functions from wtf/ASCIICType.h | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Robin Morisset <rmorisset> | ||||||
| Component: | WebGPU | Assignee: | Robin Morisset <rmorisset> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | darin, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | 233276 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Robin Morisset
2022-02-17 07:56:40 PST
Created attachment 452367 [details]
Patch
Comment on attachment 452367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=452367&action=review > Source/WebGPU/WGSL/Lexer.cpp:163 > + if (isASCIIDigit (m_current)) { Stray space here after isASCIIDigit. > Source/WebGPU/WGSL/Lexer.cpp:191 > - } else if (isIdentifierStart(m_current)) { > + } else if (isASCIIAlpha(m_current)) { Not sure this change is an improvement. Might want isIdentifierStart so the intent of the code is more apparent. The implementation of that function can use isASCIIAlpha. > Source/WebGPU/WGSL/Lexer.cpp:194 > - while (isValidIdentifierCharacter(m_current)) > + while (isASCIIAlphanumeric(m_current) || m_current == '_') Ditto. > Source/WebGPU/WGSL/Lexer.cpp:271 > - while (isWhiteSpace(m_current)) { > + while (isASCIISpace(m_current)) { It can be ambiguous sometimes which definition of whitespace to use in various contexts. Might still want a named function for that. > Source/WebGPU/WGSL/Lexer.cpp:301 > - value += readDecimal(m_current); > + value += static_cast<uint64_t>(m_current - '0'); This code looks less elegant than the old. Comment on attachment 452367 [details]
Patch
Thank you for the review, I've visibly overcorrected in eliminating my code.
I'll fix it and update the patch.
Created attachment 454058 [details]
Patch for landing
Committed r291004 (248180@main): <https://commits.webkit.org/248180@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 454058 [details]. |