Repository navigation
Conversation
per spec doc.rust-lang.org/nightly/reference/whitespace.html
eugenesvk
marked this pull request as draft
November 5, 2026 17:36
eugenesvk
marked this pull request as ready for review
November 5, 2026 18:01
This was referenced Nov 5, 2026
This branch has not been deployed
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.
I've added an excplicit rule to handle Rust-specced whitespace between tokens, driven by the need to make macros
println !()work, but made it more general to hopefully fix other unknown issues with whitespace handling. This also includes highlighting illegal whitespace charsHowever, the positive rule doesn't work in the current syntax since a macro isn't constrcucted as two tokens
printand!, so added a manual workaround to fix the specific macro issue.Though trying to use the proper(?) place for the whitespace rules (in
prototype) broke a couple of existing syntax rules, and I didn't have time to investigate/fix that so moved the whitespace rule to statements.Another potential issue is that maybe there are just not enough tests for the whitespace stuff and maybe the new rules exclude valid non-rust-whitespace whitespace chars somewhere
This PR is stacked on top of #515 for avoiding conflicts (as it's also re. macros)
Mostly addresses #556
except for newlines (left a todo in syntax test examples), which would require a more "advanced" mechanism since ST syntaxes are line-based