Skip to content

parser: Simplify treatment of macro variables in Parser::bump - #69211

Merged
bors merged 4 commits into
rust-lang:masterfrom
petrochenkov:prevtok
Feb 19, 2020
Merged

parser: Simplify treatment of macro variables in Parser::bump#69211
bors merged 4 commits into
rust-lang:masterfrom
petrochenkov:prevtok

Conversation

@petrochenkov

@petrochenkovpetrochenkov commented Feb 16, 2020

Copy link
Copy Markdown
Contributor

Follow-up to #69006.

Token normalization for $ident and $lifetime is merged directly into bump.
Special "unknown macro variable" diagnostic for unexpected $s is removed as preventing legal code from compiling (as a result bump also doesn't call itself recursively anymore and can't make prev_token inconsistent).

r? @Centril

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 16, 2020
Comment threadsrc/librustc_expand/mbe/macro_parser.rs Outdated
Comment threadsrc/test/ui/issues/issue-6596-1.rs Outdated
Comment threadsrc/librustc_parse/parser/mod.rs Outdated
@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

Added a couple more commits.

@CentrilCentril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 17, 2020
Token normalization is merged directly into `bump`.
Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling.
They are always set synchronously with normalized tokens now
@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

Updated.

@petrochenkovpetrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 17, 2020
@Centril

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Feb 17, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 950845c has been approved by Centril

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 17, 2020
Centril added a commit to Centril/rust that referenced this pull request Feb 18, 2020
parser: Simplify treatment of macro variables in `Parser::bump`
Follow-up to rust-lang#69006.
Token normalization for `$ident` and `$lifetime` is merged directly into `bump`.
Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling (as a result `bump` also doesn't call itself recursively anymore and can't make `prev_token` inconsistent).
r? @Centril
@CentrilCentril mentioned this pull request Feb 18, 2020
bors added a commit that referenced this pull request Feb 18, 2020
Rollup of 6 pull requests
Successful merges:
- #69146 (Always const qualify literals by type)
- #69159 (Select an appropriate unused lifetime name in suggestion)
- #69194 (parse: fuse associated and extern items up to defaultness)
- #69211 (parser: Simplify treatment of macro variables in `Parser::bump`)
- #69217 (Do not emit note suggesting to implement operation trait to foreign type)
- #69236 (parse: recover `mut (x @ y)` as `(mut x @ mut y)`.)
Failed merges:
r? @ghost
@bors
bors merged commit 950845c into rust-lang:masterFeb 19, 2020
bors added a commit that referenced this pull request Mar 8, 2020
rustc_parse: Remove `Parser::normalized(_prev)_token`
Perform the "normalization" (renamed to "uninterpolation") on the fly when necessary.
The final part of #69579#69384#69376#69211#69034#69006.
r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Mar 9, 2020
rustc_parse: Remove `Parser::normalized(_prev)_token`
Perform the "normalization" (renamed to "uninterpolation") on the fly when necessary.
The final part of rust-lang#69579rust-lang#69384rust-lang#69376rust-lang#69211rust-lang#69034rust-lang#69006.
r? @Centril
@petrochenkov
petrochenkov deleted the prevtok branch February 22, 2025 18:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@petrochenkov@Centril@bors@rust-highfive