Skip to content
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

add methods on the error types for reusability in wgsl-analyzer #1827

Merged
merged 2 commits into from
Apr 15, 2022

Conversation

jakobhellermann
Copy link
Contributor

I integrated naga error messages into wgsl-analyzer and in doing so made a few improvements to the error types allowing me to extract information I need.

Namely:

  • expose message and labels from frong::wgsl::ParseError
  • add as_inner(&self) -> &E to WithSpan (into_inner(self) -> E already exists)
  • add + ExactSizeIterator to the label/span iterators. This is not required but nice to have when checking whether any spans exist at all with iter.len() == 0

@jakobhellermann jakobhellermann changed the title Error message expose add methods on the error types for reusability in wgsl-analyzer Apr 14, 2022
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Looks good, looking forward to see this being used in the next release of wgsl-analyzer!

@teoxoy teoxoy merged commit 6427a66 into gfx-rs:master Apr 15, 2022
@jakobhellermann jakobhellermann deleted the error-message-expose branch April 15, 2022 11:12
jakobhellermann added a commit to jakobhellermann/naga that referenced this pull request Apr 15, 2022
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.

2 participants