-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Conversation
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. |
src/libsyntax/parse/parser.rs
Outdated
} | ||
else { | ||
self.expected_tokens.push(TokenType::Token(token::BinOp(token::Plus))); | ||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
Could you add a test with snippet from #47856 to make sure it parses? |
+=
into +
and =
in generics
I've also changed the PR name into something more descriptive (it goes into git history after merge). |
+=
into +
and =
in generics+=
into +
and =
where +
is explicitly requested (such as generics)
I added a snippet to the test folder. I hope I did that correctly, hahah... |
The test looks good |
📌 Commit aef5d17 has been approved by |
🔒 Merge conflict |
Sorry for the delay. I've pushed a formatting change that you mentioned before. How do I resolve this merge conflict? @petrochenkov |
@Crazycolorz5 You could rebase on top of the latest master. Assuming this repository's remote name is 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 |
…rison to Plus token.
85c98b5
to
759a0e0
Compare
All right, I've rebased it according to the above instructions. |
@bors r+ |
📌 Commit 759a0e0 has been approved by |
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
☀️ Test successful - status-appveyor, status-travis |
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