Skip to content

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

Merged
bors merged 6 commits into
rust-lang:masterfrom
Crazycolorz5:pluseqsplitting
Jun 9, 2018
Merged

parser: Split += into + and = where + is explicitly requested (such as generics)#51068
bors merged 6 commits into
rust-lang:masterfrom
Crazycolorz5:pluseqsplitting

Conversation

@Crazycolorz5

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

r? @petrochenkov

Comment thread src/libsyntax/parse/parser.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Formatting.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@petrochenkov

Copy link
Copy Markdown
Contributor

The test looks good
@bors r+

@bors

bors commented May 30, 2018

Copy link
Copy Markdown
Collaborator

📌 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

bors commented May 30, 2018

Copy link
Copy Markdown
Collaborator

🔒 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
Copy Markdown
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

kennytm commented Jun 2, 2018

Copy link
Copy Markdown
Member

@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
Copy Markdown
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
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jun 9, 2018

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Jun 9, 2018

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Jun 9, 2018

Copy link
Copy Markdown
Collaborator

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

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