fix(wgsl-in): Handle Unterminated Block Comments - #9356
Merged
ErichDonGubler merged 4 commits intoApr 2, 2026
Conversation
BKDaugherty
marked this pull request as ready for review
April 1, 2026 18:24
ErichDonGubler
approved these changes
Apr 2, 2026
ErichDonGubler
left a comment
Member
There was a problem hiding this comment.
Looks great! Just a couple of minor things that we can fix (if they're easy) before merging.
| message: "unterminated block comment".to_string(), | ||
| labels: vec![( | ||
| span, | ||
| "must be closed with */".into(), |
Member
There was a problem hiding this comment.
style: Let's add backticks so the actual code being suggested is clear, like so:
Suggested change
| "must be closed with */".into(), | |
| "must be closed with `*/`".into(), |
Member
There was a problem hiding this comment.
Fixed as suggested as a fixup! commit (510f538). LMK if this looks okay to you.
Contributor
Author
There was a problem hiding this comment.
Yeah looks great! Thanks for doing that!
Member
|
Not sure what's going on with the |
Adds a new token to keep track of unterminated block comments in order to emit an error to the user highlighting the offending unterminated block comment.
BKDaugherty
force-pushed
the
brendon/8877/comment-parsing
branch
from
April 2, 2026 05:41
510f538 to
584749b
Compare
Contributor
Author
|
Thanks for the quick review and fixes @ErichDonGubler! |
slyedoc
pushed a commit
to slyedoc/wgpu
that referenced
this pull request
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new token to keep track of unterminated block comments in order to emit an error to the user highlighting the offending unterminated block comment.
Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories
#8877 (comment)
When one pull request builds on another, please put "Depends on
#NNNN" towards the top of its description. This helps maintainers
notice that they shouldn't merge it until its ancestor has been
approved. Don't use draft PR status to indicate this.
Description
Describe what problem this is solving, and how it's solved.
Block comments that aren't terminated before this changeset were lexed as Token::End. This didn't give the parser enough information to report an error.
This PR introduces a new token so that this can be tracked, and reports errors when an unterminated block comment is found.
Testing
Explain how this change is tested.
This CTS test passes now. I also wrote tests.
Squash or Rebase?
Squash.
If your pull request contains multiple commits, please indicate whether
they need to be squashed into a single commit before they're merged,
or if they're ready to rebase onto
trunkas they stand. In thelatter case, please ensure that each commit passes all CI tests, so
that we can continue to bisect along
trunkto isolate bugs.Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.