mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When printing SourceRanges, add an option to not print the text as well.
Swift SVN r6836
This commit is contained in:
@@ -54,7 +54,7 @@ void SourceLoc::dump(const SourceManager &SM) const {
|
||||
}
|
||||
|
||||
void SourceRange::print(raw_ostream &OS, const SourceManager &SM,
|
||||
int &LastBuffer) const {
|
||||
int &LastBuffer, bool PrintText) const {
|
||||
OS << '[';
|
||||
Start.print(OS, SM, LastBuffer);
|
||||
OS << " - ";
|
||||
@@ -64,10 +64,12 @@ void SourceRange::print(raw_ostream &OS, const SourceManager &SM,
|
||||
if (Start.isInvalid() || End.isInvalid())
|
||||
return;
|
||||
|
||||
OS << " RangeText=\""
|
||||
<< StringRef(Start.Value.getPointer(),
|
||||
End.Value.getPointer() - Start.Value.getPointer()+1)
|
||||
<< '"';
|
||||
if (PrintText) {
|
||||
OS << " RangeText=\""
|
||||
<< StringRef(Start.Value.getPointer(),
|
||||
End.Value.getPointer() - Start.Value.getPointer()+1)
|
||||
<< '"';
|
||||
}
|
||||
}
|
||||
|
||||
void SourceRange::dump(const SourceManager &SM) const {
|
||||
|
||||
Reference in New Issue
Block a user