Skip to content

Support multi-character punct tokens in MBE #13854

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

Merged
merged 4 commits into from
Jan 2, 2023

Conversation

lowr
Copy link
Contributor

@lowr lowr commented Dec 27, 2022

Fixes #11497

In the context of MBE, consecutive puncts are parsed as multi-character punct tokens whenever possible. For example, ::: is parsed as [Punct(`::`), Punct(`:`)] and shouldn't get matched to patterns like : : : or : ::.

We have implemented this behavior only for when we match puncts against tt fragments, but not when we match puncts literally. This PR extracts the multi-character punct handling procedure into a separate method and extends its support for literal matching.

For good measure, this PR adds support for <- token, which is still considered as one token in rustc despite the placement syntax having been removed.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 27, 2022
@lowr lowr marked this pull request as draft December 27, 2022 10:27
@lowr lowr marked this pull request as ready for review December 27, 2022 16:20
@Veykril
Copy link
Member

Veykril commented Jan 2, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jan 2, 2023

📌 Commit a7d4114 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 2, 2023

⌛ Testing commit a7d4114 with merge 790759f...

@bors
Copy link
Contributor

bors commented Jan 2, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 790759f to master...

@bors bors merged commit 790759f into rust-lang:master Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False Positive macro error when using guard macro with path in pattern
4 participants