mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixes SourceLocation extraction on multiline locations with a too long first line.
This commit is contained in:
parent
d597b1dbb2
commit
c7074a365e
@ -58,7 +58,9 @@ SourceReference SourceReferenceExtractor::extract(SourceLocation const* _locatio
|
|||||||
int locationLength = isMultiline ? line.length() - start.column : end.column - start.column;
|
int locationLength = isMultiline ? line.length() - start.column : end.column - start.column;
|
||||||
if (locationLength > 150)
|
if (locationLength > 150)
|
||||||
{
|
{
|
||||||
line = line.substr(0, start.column + 35) + " ... " + line.substr(end.column - 35);
|
int const lhs = start.column + 35;
|
||||||
|
int const rhs = (isMultiline ? line.length() : end.column) - 35;
|
||||||
|
line = line.substr(0, lhs) + " ... " + line.substr(rhs);
|
||||||
end.column = start.column + 75;
|
end.column = start.column + 75;
|
||||||
locationLength = 75;
|
locationLength = 75;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user