Skip to content

Conversation

reima
Copy link
Contributor

@reima reima commented Aug 28, 2025

Connections
Fixes #8126.

Description
This change allows a trailing comma in the list of case values inside a switch.

It accomplishes this by checking if a comma is followed by a : (indicating the list of values ends here), or an attribute or { token (indicating that a compound statement follows).

Testing
I've extended naga\tests\in\wgsl\control-flow.wgsl to contain a switch with trailing commas.

Squash or Rebase?

Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

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.

Switch case not compiling
1 participant