Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

libsyntax: Refactor parser.rs into reasonably sized logical units #63469

Merged
merged 9 commits into from
Aug 12, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Aug 11, 2019

Here we split parser.rs (~7.9 KLOC) into more reasonably sized files (all < 1.8 KLOC):

  • ./src/libsyntax/parse/
    • parser.rs
    • parser/
      • pat.rs
      • expr.rs
      • stmt.rs
      • ty.rs
      • path.rs
      • generics.rs
      • item.rs
      • module.rs

Closes #60015.

r? @petrochenkov

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2019
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 11, 2019

📌 Commit bcfcbfc 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 Aug 11, 2019
@Mark-Simulacrum
Copy link
Member

@bors p=30
This is very conflict prone.

@bors
Copy link
Collaborator

bors commented Aug 12, 2019

⌛ Testing commit bcfcbfc with merge 72f8043...

bors added a commit that referenced this pull request Aug 12, 2019
libsyntax: Refactor `parser.rs` into reasonably sized logical units

Here we split `parser.rs` (~7.9 KLOC) into more reasonably sized files (all < 1.8 KLOC):

- `./src/libsyntax/parse/`
   - `parser.rs`
   - `parser/`
      - `pat.rs`
      - `expr.rs`
      - `stmt.rs`
      - `ty.rs`
      - `path.rs`
      - `generics.rs`
      - `item.rs`
      - `module.rs`

Closes #60015.

r? @petrochenkov
@bors
Copy link
Collaborator

bors commented Aug 12, 2019

☀️ Test successful - checks-azure
Approved by: petrochenkov
Pushing 72f8043 to master...

@eddyb
Copy link
Member

eddyb commented Aug 12, 2019

IMO src/libsyntax/parse/parser/ is silly, and we should flatten those two layers.

@petrochenkov
Copy link
Contributor

Dammit, didn't notice that.
When diagnostics.rs was extracted it was put into libsyntax/parse, these new files also belong there.

@Centril
Copy link
Contributor Author

Centril commented Aug 12, 2019

Sure, seems reasonable; let's merge them soonish; I have some other refactors I'd like to do first tho.

@petrochenkov
Copy link
Contributor

Also, while we are at it, src\libsyntax\parse\classify.rs is tiny and can be merged into somewhere, and src\libsyntax\parse\unescape_error_reporting.rs belongs to src\libsyntax\parse\lexer.

@petrochenkov
Copy link
Contributor

(Better to do it faster so people don't have to rebase again.)

# for free to join this conversation on GitHub. Already have an account? # 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.

libsyntax/parse/parser.rs became too big for GitHub
6 participants