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

wgsl-in: Fix inclusion of trivia in spans #2055

Merged
merged 2 commits into from
Sep 15, 2022

Conversation

SparkyPotato
Copy link
Contributor

This fixes #2053 for all cases, ensuring that no spans have leading or trailing trivia in them.

The lexer API is changed to have .start_byte_offset() and .end_byte_offset(), to be used when trying to get the byte offset of the start and end of a node, respectively.

@SparkyPotato SparkyPotato changed the title Fix inclusion of trivia in spans wgsl-in: Fix inclusion of trivia in spans Sep 13, 2022
@SparkyPotato SparkyPotato marked this pull request as draft September 14, 2022 06:15
@SparkyPotato SparkyPotato marked this pull request as ready for review September 14, 2022 06:22
Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

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

This looks fantastic. Thank you very much!

@jimblandy jimblandy merged commit 4f8db99 into gfx-rs:master Sep 15, 2022
@SparkyPotato SparkyPotato deleted the fix-span-trivia branch September 15, 2022 07:19
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.

Spans on expressions are bad
2 participants