aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-12-06 21:01:39 +0800
committerGitHub <noreply@github.com>2018-12-06 21:01:39 +0800
commit0e8841005ca7bf93545a1bc76bd8fa0ed67cb32d (patch)
treea247b6ea5b9b305e60d9e4d403e805335415ba6f /test/libsolidity
parent1643d63e3af1b0e3aabac2f2ded3619505d0fa8c (diff)
parent073b03d90c8f0648ba135f0b30d8e72fd871478f (diff)
downloaddexon-solidity-0e8841005ca7bf93545a1bc76bd8fa0ed67cb32d.tar.gz
dexon-solidity-0e8841005ca7bf93545a1bc76bd8fa0ed67cb32d.tar.zst
dexon-solidity-0e8841005ca7bf93545a1bc76bd8fa0ed67cb32d.zip
Merge pull request #5554 from ethereum/cp-SourceReferenceFormatter-refactor
[2/3] Refactor SourceReferenceFormatter (split-out data extraction & make use of new SourceLocation knowledge)
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/AnalysisFramework.cpp3
-rw-r--r--test/libsolidity/GasMeter.cpp3
-rw-r--r--test/libsolidity/SolidityExecutionFramework.h3
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(