Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Explicitly handle Rust whitespace - #558

Open
eugenesvk wants to merge 6 commits into
rust-lang:masterfrom
eugenesvk:fr-macros+ws
Open

eugenesvk wants to merge 6 commits into
rust-lang:masterfrom
eugenesvk:fr-macros+ws

Conversation

@eugenesvk

@eugenesvk eugenesvk commented Nov 5, 2026 •

Copy link
Copy Markdown

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 chars

However, the positive rule doesn't work in the current syntax since a macro isn't constrcucted as two tokens print and !, 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

@eugenesvk
eugenesvk marked this pull request as draft November 5, 2026 17:36
@eugenesvk
eugenesvk marked this pull request as ready for review November 5, 2026 18:01

This branch has not been deployed

No deployments
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.

1 participant