RESOLVED FIXED 236783
[WGSL] The lexer should use the functions from wtf/ASCIICType.h
https://bugs.webkit.org/show_bug.cgi?id=236783
Summary [WGSL] The lexer should use the functions from wtf/ASCIICType.h
Robin Morisset
Reported 2022-02-17 07:56:40 PST
As suggested by Darin in a post-landing review of https://bugs.webkit.org/show_bug.cgi?id=233276.
Attachments
Patch (7.48 KB, patch)
2022-02-17 07:59 PST, Robin Morisset
darin: review+
rmorisset: commit-queue-
Patch for landing (7.19 KB, patch)
2022-03-07 18:28 PST, Robin Morisset
no flags
Robin Morisset
Comment 1 2022-02-17 07:59:56 PST
Darin Adler
Comment 2 2022-02-17 10:07:17 PST
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.
Robin Morisset
Comment 3 2022-02-17 11:02:34 PST
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.
Radar WebKit Bug Importer
Comment 4 2022-02-24 07:57:18 PST
Robin Morisset
Comment 5 2022-03-07 18:28:15 PST
Created attachment 454058 [details] Patch for landing
EWS
Comment 6 2022-03-08 12:16:19 PST
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].
Note You need to log in before you can comment on or make changes to this bug.