-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WGSL] Ignore extraneous semicolons in statements and declarations #9389
[WGSL] Ignore extraneous semicolons in statements and declarations #9389
Conversation
EWS run on previous version of this PR (hash 91962ad) |
Source/WebGPU/WGSL/Parser.cpp
Outdated
@@ -530,16 +535,16 @@ Expected<UniqueRef<AST::Statement>, Error> Parser<Lexer>::parseStatement() | |||
{ | |||
START_PARSE(); | |||
|
|||
if (current().m_type == TokenType::Semicolon) { | |||
consume(); | |||
return parseStatement(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a loop instead of recursive? (I'm thinking about stack space)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
91962ad
to
a80cb1b
Compare
EWS run on current version of this PR (hash a80cb1b) |
https://bugs.webkit.org/show_bug.cgi?id=251442 rdar://104873247 Reviewed by Myles C. Maxfield. Update parser to match the spec: semicolons are valid statements and declarations. Add the code to `parseGlobalDecl` to skip semicolons and update `parseStatement` so we don't allocate an empty node if we find extraneous semicolons. * Source/WebGPU/WGSL/Parser.cpp: (WGSL::Parser<Lexer>::parseGlobalDecl): (WGSL::Parser<Lexer>::parseStatement): Canonical link: https://commits.webkit.org/259668@main
a80cb1b
to
4ce5ef2
Compare
Committed 259668@main (4ce5ef2): https://commits.webkit.org/259668@main Reviewed commits have been landed. Closing PR #9389 and removing active labels. |
4ce5ef2
a80cb1b
π gtkπ wincairoπ§ͺ ios-wk2π§ͺ gtk-wk2π§ͺ api-iosπ§ͺ api-gtkπ§ͺ mac-wk2π tv-simπ§ͺ mac-AS-debug-wk2