Modified SourceLocation::hasText() to allow empty source.

This commit is contained in:
alex
2020-02-04 04:19:28 +01:00
committed by alex
parent 351c39efb5
commit 211227f50b
4 changed files with 9 additions and 9 deletions
+3 -2
View File
@@ -76,7 +76,8 @@ struct SourceLocation
source &&
0 <= start &&
start <= end &&
end <= int(source->source().length());
// in some cases (json import) source->source() can be empty
(source->source().empty() || end <= int(source->source().length()));
}
std::string text() const
@@ -124,7 +125,7 @@ inline std::ostream& operator<<(std::ostream& _out, SourceLocation const& _locat
if (_location.source)
_out << _location.source->name();
_out << "[" << _location.start << "," << _location.end << "]";
_out << "[" << _location.start << "," << _location.end << ")";
return _out;
}