Merge pull request #5554 from ethereum/cp-SourceReferenceFormatter-refactor

[2/3] Refactor SourceReferenceFormatter (split-out data extraction & make use of new SourceLocation knowledge)
This commit is contained in:
chriseth
2018-12-06 14:01:39 +01:00
committed by GitHub
16 changed files with 234 additions and 126 deletions
+4 -4
View File
@@ -67,9 +67,9 @@ namespace po = boost::program_options;
class YulOpti
{
public:
void printErrors(Scanner const& _scanner)
void printErrors()
{
SourceReferenceFormatter formatter(cout, [&](string const&) -> Scanner const& { return _scanner; });
SourceReferenceFormatter formatter(cout);
for (auto const& error: m_errors)
formatter.printExceptionInformation(
@@ -86,7 +86,7 @@ public:
if (!m_ast || !errorReporter.errors().empty())
{
cout << "Error parsing source." << endl;
printErrors(*scanner);
printErrors();
return false;
}
m_analysisInfo = make_shared<yul::AsmAnalysisInfo>();
@@ -100,7 +100,7 @@ public:
if (!analyzer.analyze(*m_ast) || !errorReporter.errors().empty())
{
cout << "Error analyzing source." << endl;
printErrors(*scanner);
printErrors();
return false;
}
return true;