1
Fork 0

Clarify that the diff_marker is talking about version control system

conflicts specifically and a few more improvements.
This commit is contained in:
ardi 2024-05-08 14:22:09 +02:00
parent 8dc6a5d145
commit 1f6d271527
5 changed files with 47 additions and 38 deletions

View file

@ -567,7 +567,7 @@ impl<'a> Parser<'a> {
if self.token == token::Eof {
break;
}
if self.is_diff_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) {
if self.is_vcs_conflict_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) {
// Account for `<<<<<<<` diff markers. We can't proactively error here because
// that can be a valid path start, so we snapshot and reparse only we've
// encountered another parse error.
@ -576,7 +576,7 @@ impl<'a> Parser<'a> {
let stmt = match self.parse_full_stmt(recover) {
Err(mut err) if recover.yes() => {
if let Some(ref mut snapshot) = snapshot {
snapshot.recover_diff_marker();
snapshot.recover_vcs_conflict_marker();
}
if self.token == token::Colon {
// if a previous and next token of the current one is