Skip to content
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

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

Merged
merged 3 commits into from
May 16, 2019

Conversation

matklad
Copy link
Member

@matklad matklad commented May 12, 2019

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
Member Author

matklad commented May 12, 2019

r? @petrochenkov

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

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

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

matklad commented May 13, 2019

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

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
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 14, 2019

📌 Commit e249f2e has been approved by petrochenkov

@bors bors 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
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
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
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
@bors
Copy link
Contributor

bors commented May 16, 2019

⌛ 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
Copy link
Contributor

bors commented May 16, 2019

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 16, 2019
@bors bors merged commit e249f2e into rust-lang:master May 16, 2019
@matklad matklad deleted the tt-parser branch May 16, 2019 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: 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