Skip to content

parser: Split += into + and = where + is explicitly requested (such as generics) #51068

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

Merged
merged 6 commits into from
Jun 9, 2018

Conversation

Crazycolorz5
Copy link
Contributor

Added functions in tokens to check whether a token leads with +. Used them when parsing to allow for token splitting of += into + and =.
Fixes #47856

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2018
@michaelwoerister
Copy link
Member

r? @petrochenkov

}
else {
self.expected_tokens.push(TokenType::Token(token::BinOp(token::Plus)));
false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand, Could you give a bit more detail as to what you mean by that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant these lines are indented too much (8 spaces instead of 4).

@petrochenkov
Copy link
Contributor

Could you add a test with snippet from #47856 to make sure it parses?
https://github.com/rust-lang/rust/blob/master/src/test/parse-fail/trait-object-trait-parens.rs can be used as an example.

@petrochenkov petrochenkov 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 May 29, 2018
@petrochenkov petrochenkov changed the title Fix Issue 47856 parser: Split += into + and = in generics May 29, 2018
@petrochenkov
Copy link
Contributor

I've also changed the PR name into something more descriptive (it goes into git history after merge).

@Crazycolorz5 Crazycolorz5 changed the title parser: Split += into + and = in generics parser: Split += into + and = where + is explicitly requested (such as generics) May 29, 2018
@Crazycolorz5
Copy link
Contributor Author

I added a snippet to the test folder. I hope I did that correctly, hahah...

@petrochenkov
Copy link
Contributor

The test looks good
@bors r+

@bors
Copy link
Collaborator

bors commented May 30, 2018

📌 Commit aef5d17 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 30, 2018
@bors
Copy link
Collaborator

bors commented May 30, 2018

🔒 Merge conflict

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 30, 2018
@Crazycolorz5
Copy link
Contributor Author

Sorry for the delay. I've pushed a formatting change that you mentioned before. How do I resolve this merge conflict? @petrochenkov

@kennytm
Copy link
Member

kennytm commented Jun 2, 2018

@Crazycolorz5 You could rebase on top of the latest master. Assuming this repository's remote name is upstream and your fork is self, you run the following in the command line:

git checkout master

git pull upstream master --ff-only

git checkout rust 

git rebase master 

# follow on-screen instruction to fix any merge conflict

git push self rust --force-with-lease

@Crazycolorz5
Copy link
Contributor Author

All right, I've rebased it according to the above instructions.

@kennytm kennytm 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 Jun 5, 2018
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 9, 2018

📌 Commit 759a0e0 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 Jun 9, 2018
@bors
Copy link
Collaborator

bors commented Jun 9, 2018

⌛ Testing commit 759a0e0 with merge 61d8831...

bors added a commit that referenced this pull request Jun 9, 2018
parser: Split `+=` into `+` and `=` where `+` is explicitly requested (such as generics)

Added functions in tokens to check whether a token leads with `+`. Used them when parsing to allow for token splitting of `+=` into `+` and `=`.
Fixes #47856
@bors
Copy link
Collaborator

bors commented Jun 9, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing 61d8831 to master...

@bors bors merged commit 759a0e0 into rust-lang:master Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants