Skip to content

Move token tree related lexer state to a separate struct - #60763

Merged
bors merged 3 commits into
rust-lang:masterfrom
matklad:tt-parser
May 16, 2019
Merged

Move token tree related lexer state to a separate struct#60763
bors merged 3 commits into
rust-lang:masterfrom
matklad:tt-parser

Conversation

@matklad

Copy link
Copy Markdown
Contributor

Just a types-based refactoring.

We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer

@matklad

Copy link
Copy Markdown
ContributorAuthor

r? @petrochenkov

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 12, 2019
@matklad
matkladforce-pushed the tt-parser branch 3 times, most recently from 248b837 to 64d1066CompareMay 13, 2019 11:34
@matklad

matklad commented May 13, 2019

Copy link
Copy Markdown
ContributorAuthor

Turns out it is possible to move a whole bunch of stuff to tt-specifc code.

Previously, StringReader played a dual role of both producer and consumer of tokens. Now consumption and peeking logic is fully within TokenTreesReader.

If the logic for joint-ness checking looks strange it is because it was, in fact, pretty non-obvious. See https://github.com/rust-lang/rust/pull/50838/files#r283296243

matklad added 3 commits May 13, 2019 14:54
We only used a bunch of fields when tokenizing into a token tree,
so let's move them out of the base lexer
See https://github.com/rust-lang/rust/pull/50838/files#r283296243 for
explanation how jointness checking works with *next* pair
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 14, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit e249f2e has been approved by petrochenkov

@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 May 14, 2019
Centril added a commit to Centril/rust that referenced this pull request May 15, 2019
Move token tree related lexer state to a separate struct
Just a types-based refactoring.
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
@CentrilCentril mentioned this pull request May 15, 2019
Centril added a commit to Centril/rust that referenced this pull request May 15, 2019
Move token tree related lexer state to a separate struct
Just a types-based refactoring.
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
@CentrilCentril mentioned this pull request May 15, 2019
Centril added a commit to Centril/rust that referenced this pull request May 15, 2019
Move token tree related lexer state to a separate struct
Just a types-based refactoring.
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
@CentrilCentril mentioned this pull request May 15, 2019
bors added a commit that referenced this pull request May 15, 2019
Rollup of 9 pull requests
Successful merges:
- #59825 (string: implement From<&String> for String)
- #59923 (Fix convert module's documentation links)
- #60691 (Include expression to wait for to the span of Await)
- #60763 (Move token tree related lexer state to a separate struct)
- #60769 (Update rustc book CLI docs.)
- #60811 (Bump measureme dependency to 0.3)
- #60816 (README.md: Mention MSVC 2017+, not 2013(!))
- #60827 (Use `Symbol` more in lint APIs)
- #60851 (Move `box` from the stable keyword to unstable keywords list)
Failed merges:
r? @ghost
Centril added a commit to Centril/rust that referenced this pull request May 15, 2019
Move token tree related lexer state to a separate struct
Just a types-based refactoring.
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
@CentrilCentril mentioned this pull request May 15, 2019
@bors

bors commented May 16, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit e249f2e with merge 024c25d...

bors added a commit that referenced this pull request May 16, 2019
Move token tree related lexer state to a separate struct
Just a types-based refactoring.
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
@bors

bors commented May 16, 2019

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-travis, status-appveyor
Approved by: petrochenkov
Pushing 024c25d to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label May 16, 2019
@bors
bors merged commit e249f2e into rust-lang:masterMay 16, 2019
@matklad
matklad deleted the tt-parser branch May 16, 2019 11:17
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.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.

5 participants

@matklad@rust-highfive@petrochenkov@bors@pnkfelix