mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #470 from chriseth/redundancy
Remove code duplication in source references formatter.
This commit is contained in:
@@ -120,8 +120,9 @@ 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!");
|
||||
SourceReferenceFormatter::printSourceLocation(cout, first->first->location(), m_compiler.scanner());
|
||||
SourceReferenceFormatter::printSourceLocation(cout, second->first->location(), m_compiler.scanner());
|
||||
auto scannerFromSource = [&](string const&) -> Scanner const& { return m_compiler.scanner(); };
|
||||
SourceReferenceFormatter::printSourceLocation(cout, &first->first->location(), scannerFromSource);
|
||||
SourceReferenceFormatter::printSourceLocation(cout, &second->first->location(), scannerFromSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user