mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Avoided trailing \r
in CharStream::lineAtPosition().
This commit is contained in:
parent
e8eb1f2d14
commit
be1d92c836
@ -93,10 +93,13 @@ string CharStream::lineAtPosition(int _position) const
|
||||
lineStart = 0;
|
||||
else
|
||||
lineStart++;
|
||||
return m_source.substr(
|
||||
string line = m_source.substr(
|
||||
lineStart,
|
||||
min(m_source.find('\n', lineStart), m_source.size()) - lineStart
|
||||
);
|
||||
if (!line.empty() && line.back() == '\r')
|
||||
line.pop_back();
|
||||
return line;
|
||||
}
|
||||
|
||||
tuple<int, int> CharStream::translatePositionToLineColumn(int _position) const
|
||||
|
Loading…
Reference in New Issue
Block a user