diff options
author | Christian Parpart <christian@ethereum.org> | 2018-11-30 21:34:08 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-12-06 21:01:01 +0800 |
commit | 073b03d90c8f0648ba135f0b30d8e72fd871478f (patch) | |
tree | b38bf2ef623bb1ac85bf9ca929ba61f76c05bd0d /test/libsolidity | |
parent | 6efe2a526691f42e83b11cf670ec3e7f51927b3e (diff) | |
download | dexon-solidity-073b03d90c8f0648ba135f0b30d8e72fd871478f.tar.gz dexon-solidity-073b03d90c8f0648ba135f0b30d8e72fd871478f.tar.zst dexon-solidity-073b03d90c8f0648ba135f0b30d8e72fd871478f.zip |
liblangutil: refactor SourceReferenceFormatter, splitting out retrieval and making use of new SourceLocation's CharStream knowledge
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/AnalysisFramework.cpp | 3 | ||||
-rw-r--r-- | test/libsolidity/GasMeter.cpp | 3 | ||||
-rw-r--r-- | test/libsolidity/SolidityExecutionFramework.h | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/test/libsolidity/AnalysisFramework.cpp b/test/libsolidity/AnalysisFramework.cpp index bd24115c..8a72f996 100644 --- a/test/libsolidity/AnalysisFramework.cpp +++ b/test/libsolidity/AnalysisFramework.cpp @@ -127,8 +127,7 @@ string AnalysisFramework::formatError(Error const& _error) const { return SourceReferenceFormatter::formatExceptionInformation( _error, - (_error.type() == Error::Type::Warning) ? "Warning" : "Error", - [&](std::string const& _sourceName) -> Scanner const& { return m_compiler.scanner(_sourceName); } + (_error.type() == Error::Type::Warning) ? "Warning" : "Error" ); } diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 601948bc..5535bd74 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -138,8 +138,7 @@ BOOST_AUTO_TEST_CASE(non_overlapping_filtered_costs) if (first->first->location().intersects(second->first->location())) { BOOST_CHECK_MESSAGE(false, "Source locations should not overlap!"); - auto scannerFromSource = [&](string const& _sourceName) -> Scanner const& { return m_compiler.scanner(_sourceName); }; - SourceReferenceFormatter formatter(cout, scannerFromSource); + SourceReferenceFormatter formatter(cout); formatter.printSourceLocation(&first->first->location()); formatter.printSourceLocation(&second->first->location()); diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h index cedbf51a..73377eb9 100644 --- a/test/libsolidity/SolidityExecutionFramework.h +++ b/test/libsolidity/SolidityExecutionFramework.h @@ -72,8 +72,7 @@ public: m_compiler.setOptimiserSettings(m_optimize, m_optimizeRuns); if (!m_compiler.compile()) { - auto scannerFromSourceName = [&](std::string const& _sourceName) -> langutil::Scanner const& { return m_compiler.scanner(_sourceName); }; - langutil::SourceReferenceFormatter formatter(std::cerr, scannerFromSourceName); + langutil::SourceReferenceFormatter formatter(std::cerr); for (auto const& error: m_compiler.errors()) formatter.printExceptionInformation( |