mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use endl instead of "\n".
This commit is contained in:
parent
f8038792ca
commit
33babb0c6f
@ -406,7 +406,7 @@ void ASTPrinter::printSourcePart(ASTNode const& _node)
|
||||
{
|
||||
Location const& location(_node.getLocation());
|
||||
*m_ostream << getIndentation() << " Source: |"
|
||||
<< m_source.substr(location.start, location.end - location.start) << "|\n";
|
||||
<< m_source.substr(location.start, location.end - location.start) << "|" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ std::string ASTPrinter::getIndentation() const
|
||||
|
||||
void ASTPrinter::writeLine(std::string const& _line)
|
||||
{
|
||||
*m_ostream << getIndentation() << _line << '\n';
|
||||
*m_ostream << getIndentation() << _line << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,16 +42,16 @@ void SourceReferenceFormatter::printSourceLocation(std::ostream& _stream,
|
||||
std::tie(endLine, endColumn) = _scanner.translatePositionToLineColumn(_location.end);
|
||||
if (startLine == endLine)
|
||||
{
|
||||
_stream << _scanner.getLineAtPosition(_location.start) << "\n"
|
||||
_stream << _scanner.getLineAtPosition(_location.start) << std::endl
|
||||
<< std::string(startColumn, ' ') << "^";
|
||||
if (endColumn > startColumn + 2)
|
||||
_stream << std::string(endColumn - startColumn - 2, '-');
|
||||
if (endColumn > startColumn + 1)
|
||||
_stream << "^";
|
||||
_stream << "\n";
|
||||
_stream << std::endl;
|
||||
}
|
||||
else
|
||||
_stream << _scanner.getLineAtPosition(_location.start) << "\n"
|
||||
_stream << _scanner.getLineAtPosition(_location.start) << std::endl
|
||||
<< std::string(startColumn, ' ') << "^\n"
|
||||
<< "Spanning multiple lines.\n";
|
||||
}
|
||||
@ -63,8 +63,8 @@ void SourceReferenceFormatter::printSourcePosition(std::ostream& _stream,
|
||||
int line;
|
||||
int column;
|
||||
std::tie(line, column) = _scanner.translatePositionToLineColumn(_position);
|
||||
_stream << "at line " << (line + 1) << ", column " << (column + 1) << "\n"
|
||||
<< _scanner.getLineAtPosition(_position) << "\n"
|
||||
_stream << "at line " << (line + 1) << ", column " << (column + 1) << std::endl
|
||||
<< _scanner.getLineAtPosition(_position) << std::endl
|
||||
<< std::string(column, ' ') << "^" << std::endl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user