@@ -429,6 +429,7 @@ namespace ts {
429429 case CharacterCodes . slash :
430430 // starts of normal trivia
431431 case CharacterCodes . lessThan :
432+ case CharacterCodes . bar :
432433 case CharacterCodes . equals :
433434 case CharacterCodes . greaterThan :
434435 // Starts of conflict marker trivia
@@ -496,6 +497,7 @@ namespace ts {
496497 break ;
497498
498499 case CharacterCodes . lessThan :
500+ case CharacterCodes . bar :
499501 case CharacterCodes . equals :
500502 case CharacterCodes . greaterThan :
501503 if ( isConflictMarkerTrivia ( text , pos ) ) {
@@ -562,12 +564,12 @@ namespace ts {
562564 }
563565 }
564566 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.
568570 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 ) ) {
571573 break ;
572574 }
573575
@@ -1562,6 +1564,16 @@ namespace ts {
15621564 pos ++ ;
15631565 return token = SyntaxKind . OpenBraceToken ;
15641566 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+
15651577 if ( text . charCodeAt ( pos + 1 ) === CharacterCodes . bar ) {
15661578 return pos += 2 , token = SyntaxKind . BarBarToken ;
15671579 }
0 commit comments