Skip to content

Fix template list discovery algorithm: missing continue #5270

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

dneto0
Copy link
Contributor

@dneto0 dneto0 commented Jul 30, 2025

At the end of the first 'if' clause, where '<' is matched, insert a 'Start the next iteration of the loop.'
Otherwise execution reaches the 'advance token' at the bottom of the loop.

For example, in parsing: X < Y >
The '>' would be consumed too early, and template list discovery gets the wrong answer.

Fixes: #5246

At the end of the first 'if' clause, where '<' is matched,
insert a 'Start the next iteration of the loop.'
Otherwise execution reaches the 'advance token' at the bottom
of the loop.

For example, in parsing:  X < Y >
The '>' would be consumed too early, and template list discovery
gets the wrong answer.

Fixes: gpuweb#5246
Copy link
Contributor

Previews, as seen when this build job started (d286ece):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

Copy link
Member

@mehmetoguzderin mehmetoguzderin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much for the PR! Also thank you very much @k2d222 for pointing this out.

@mehmetoguzderin mehmetoguzderin merged commit 4ee7acf into gpuweb:main Jul 30, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WGSL: Bug in template list discovery algorithm
2 participants