Skip to content

syntax: cleanup param, method, and misc parsing - #64910

Merged
bors merged 21 commits into
rust-lang:masterfrom
Centril:params-cleanup
Oct 2, 2019
Merged

syntax: cleanup param, method, and misc parsing#64910
bors merged 21 commits into
rust-lang:masterfrom
Centril:params-cleanup

Conversation

@Centril

@CentrilCentril commented Sep 30, 2019

Copy link
Copy Markdown
Contributor

Do some misc cleanup of the parser:

Next up in a different PR:

r? @petrochenkov

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 30, 2019
@CentrilCentril changed the title syntax: cleanup parameter and method parsing[WIP] syntax: cleanup parameter and method parsingSep 30, 2019
@CentrilCentril changed the title [WIP] syntax: cleanup parameter and method parsing[WIP] syntax: cleanup param, method, and misc parsingSep 30, 2019
@CentrilCentril changed the title [WIP] syntax: cleanup param, method, and misc parsingsyntax: cleanup param, method, and misc parsingSep 30, 2019
@petrochenkov

Copy link
Copy Markdown
Contributor

@Centril
Please, merge parse_self_param back into a single function.
Fragmenting implementation like this is harmful for readability.
I may be biased because I wrote it, but from my point of view it's written exactly like it should be (except for moving ifs on arms perhaps).

@petrochenkov

Copy link
Copy Markdown
Contributor

I think the end goal here is unified syntax and AST representation for free, trait, impl and foreign items (#48137) with inappropriate qualifiers or selfs, missing bodies, etc reported as semantic errors.

@petrochenkov

Copy link
Copy Markdown
Contributor

merge ... back into a single function

Same applies to parse_visibility, except perhaps for the diagnostics/recovery-only part.

Comment threadsrc/libsyntax/parse/parser.rs Outdated
Comment threadsrc/libsyntax/parse/parser/item.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

Otherwise, LGTM.

@petrochenkovpetrochenkov 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 Sep 30, 2019
@bors

bors commented Oct 1, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 5c5dd80 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@CentrilCentril mentioned this pull request Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@CentrilCentril mentioned this pull request Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@CentrilCentril mentioned this pull request Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@CentrilCentril mentioned this pull request Oct 1, 2019
bors added a commit that referenced this pull request Oct 1, 2019
Rollup of 5 pull requests
Successful merges:
- #63416 (apfloat: improve doc comments)
- #64404 (Add long error explanation for E0495)
- #64910 (syntax: cleanup param, method, and misc parsing)
- #64912 (Remove unneeded `fn main` blocks from docs)
- #64952 (Update cargo.)
Failed merges:
r? @ghost
tmandry added a commit to tmandry/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@tmandrytmandry mentioned this pull request Oct 1, 2019
tmandry added a commit to tmandry/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@tmandrytmandry mentioned this pull request Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@CentrilCentril mentioned this pull request Oct 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 1, 2019
syntax: cleanup param, method, and misc parsing
Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.
Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).
r? @petrochenkov
@CentrilCentril mentioned this pull request Oct 1, 2019
bors added a commit that referenced this pull request Oct 1, 2019
Rollup of 7 pull requests
Successful merges:
- #63416 (apfloat: improve doc comments)
- #64820 (BTreeSet intersection, is_subset & difference optimizations)
- #64910 (syntax: cleanup param, method, and misc parsing)
- #64912 (Remove unneeded `fn main` blocks from docs)
- #64933 (Fixes#64919. Suggest fix based on operator precendence.)
- #64943 (Add lower bound doctests for `saturating_{add,sub}` signed ints)
- #64950 (Simplify interners)
Failed merges:
r? @ghost
@bors
bors merged commit 5c5dd80 into rust-lang:masterOct 2, 2019
@Centril
Centril deleted the params-cleanup branch October 2, 2019 16:24
Centril added a commit to Centril/rust that referenced this pull request Oct 8, 2019
syntax: more cleanups in item and function signature parsing
Follow up to rust-lang#64910.
Best read commit-by-commit.
r? @estebank
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

@Centril@petrochenkov@bors@rust-highfive