@@ -429,6 +429,7 @@ namespace ts {
429
429
case CharacterCodes . slash :
430
430
// starts of normal trivia
431
431
case CharacterCodes . lessThan :
432
+ case CharacterCodes . bar :
432
433
case CharacterCodes . equals :
433
434
case CharacterCodes . greaterThan :
434
435
// Starts of conflict marker trivia
@@ -496,6 +497,7 @@ namespace ts {
496
497
break ;
497
498
498
499
case CharacterCodes . lessThan :
500
+ case CharacterCodes . bar :
499
501
case CharacterCodes . equals :
500
502
case CharacterCodes . greaterThan :
501
503
if ( isConflictMarkerTrivia ( text , pos ) ) {
@@ -562,12 +564,12 @@ namespace ts {
562
564
}
563
565
}
564
566
else {
565
- Debug . assert ( ch === CharacterCodes . equals ) ;
566
- // Consume everything from the start of the mid-conflict marker to the start of the next
567
- // end-conflict marker.
567
+ Debug . assert ( ch === CharacterCodes . bar || ch === CharacterCodes . equals ) ;
568
+ // Consume everything from the start of a ||||||| or ======= marker to the start
569
+ // of the next ======= or >>>>>>> marker.
568
570
while ( pos < len ) {
569
- const ch = text . charCodeAt ( pos ) ;
570
- if ( ch === CharacterCodes . greaterThan && isConflictMarkerTrivia ( text , pos ) ) {
571
+ const currentChar = text . charCodeAt ( pos ) ;
572
+ if ( ( currentChar === CharacterCodes . equals || currentChar === CharacterCodes . greaterThan ) && currentChar !== ch && isConflictMarkerTrivia ( text , pos ) ) {
571
573
break ;
572
574
}
573
575
@@ -1562,6 +1564,16 @@ namespace ts {
1562
1564
pos ++ ;
1563
1565
return token = SyntaxKind . OpenBraceToken ;
1564
1566
case CharacterCodes . bar :
1567
+ if ( isConflictMarkerTrivia ( text , pos ) ) {
1568
+ pos = scanConflictMarkerTrivia ( text , pos , error ) ;
1569
+ if ( skipTrivia ) {
1570
+ continue ;
1571
+ }
1572
+ else {
1573
+ return token = SyntaxKind . ConflictMarkerTrivia ;
1574
+ }
1575
+ }
1576
+
1565
1577
if ( text . charCodeAt ( pos + 1 ) === CharacterCodes . bar ) {
1566
1578
return pos += 2 , token = SyntaxKind . BarBarToken ;
1567
1579
}
0 commit comments