mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SyntaxColoring] Address review feedback for rdar://problem/33463141 NFC
This commit is contained in:
@@ -300,18 +300,15 @@ struct SwiftEditorCharRange {
|
|||||||
bool intersects(const SwiftSyntaxToken &Token) const {
|
bool intersects(const SwiftSyntaxToken &Token) const {
|
||||||
return this->Offset < (Token.endOffset()) && this->EndOffset > Token.Offset;
|
return this->Offset < (Token.endOffset()) && this->EndOffset > Token.Offset;
|
||||||
}
|
}
|
||||||
void extendToInclude(unsigned OtherOffset) {
|
|
||||||
if (OtherOffset < Offset)
|
|
||||||
Offset = OtherOffset;
|
|
||||||
else if (OtherOffset > EndOffset)
|
|
||||||
EndOffset = OtherOffset;
|
|
||||||
}
|
|
||||||
void extendToInclude(const SwiftEditorCharRange &Range) {
|
void extendToInclude(const SwiftEditorCharRange &Range) {
|
||||||
if (Range.Offset < Offset)
|
if (Range.Offset < Offset)
|
||||||
Offset = Range.Offset;
|
Offset = Range.Offset;
|
||||||
if (Range.EndOffset > EndOffset)
|
if (Range.EndOffset > EndOffset)
|
||||||
EndOffset = Range.EndOffset;
|
EndOffset = Range.EndOffset;
|
||||||
}
|
}
|
||||||
|
void extendToInclude(unsigned OtherOffset) {
|
||||||
|
extendToInclude({OtherOffset, OtherOffset});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Finds and represents the first mismatching tokens in two syntax maps,
|
/// Finds and represents the first mismatching tokens in two syntax maps,
|
||||||
|
|||||||
Reference in New Issue
Block a user