Skip to content

Support multi-character punct tokens in MBE#13854

Merged
bors merged 4 commits into
rust-lang:masterfrom
lowr:fix/mbe-glue-punct
Jan 2, 2023
Merged

Support multi-character punct tokens in MBE#13854
bors merged 4 commits into
rust-lang:masterfrom
lowr:fix/mbe-glue-punct

Conversation

@lowr

@lowr lowr commented Dec 27, 2022

Copy link
Copy Markdown
Contributor

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

Veykril commented Jan 2, 2023

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Jan 2, 2023

Copy link
Copy Markdown
Contributor

📌 Commit a7d4114 has been approved by Veykril

It is now in the queue for this repository.

@bors

bors commented Jan 2, 2023

Copy link
Copy Markdown
Contributor

⌛ Testing commit a7d4114 with merge 790759f...

@bors

bors commented Jan 2, 2023

Copy link
Copy Markdown
Contributor

☀️ 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