mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul-phaser] Program: Output operator for ErrorList
- It does not seem universal enough to put it in liblangutil but in the scope of yul-phaser it's generic enough so I'm going to keep it together with Program.
This commit is contained in:
parent
e5a49e2556
commit
9ef63a9789
@ -22,6 +22,7 @@
|
||||
#include <liblangutil/CharStream.h>
|
||||
#include <liblangutil/ErrorReporter.h>
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
#include <libyul/AsmAnalysis.h>
|
||||
#include <libyul/AsmAnalysisInfo.h>
|
||||
@ -57,6 +58,16 @@ ostream& operator<<(ostream& _stream, Program const& _program);
|
||||
|
||||
}
|
||||
|
||||
ostream& std::operator<<(ostream& _outputStream, ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(_outputStream);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
||||
return _outputStream;
|
||||
}
|
||||
|
||||
Program::Program(Program const& program):
|
||||
m_ast(make_unique<Block>(get<Block>(ASTCopier{}(*program.m_ast)))),
|
||||
m_dialect{program.m_dialect},
|
||||
|
@ -41,6 +41,13 @@ struct Dialect;
|
||||
|
||||
}
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
std::ostream& operator<<(std::ostream& _outputStream, solidity::langutil::ErrorList const& _errors);
|
||||
|
||||
}
|
||||
|
||||
namespace solidity::phaser
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user