mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
AnalysisFramework: Add filteredErrors()
This commit is contained in:
parent
e62bc30e9e
commit
6f3a379557
@ -68,7 +68,7 @@ AnalysisFramework::parseAnalyseAndReturnError(
|
|||||||
|
|
||||||
compiler().analyze();
|
compiler().analyze();
|
||||||
|
|
||||||
ErrorList errors = filterErrors(compiler().errors(), _reportWarnings);
|
ErrorList errors = filteredErrors(_reportWarnings);
|
||||||
if (errors.size() > 1 && !_allowMultipleErrors)
|
if (errors.size() > 1 && !_allowMultipleErrors)
|
||||||
BOOST_FAIL("Multiple errors found: " + formatErrors());
|
BOOST_FAIL("Multiple errors found: " + formatErrors());
|
||||||
|
|
||||||
|
@ -68,6 +68,10 @@ protected:
|
|||||||
|
|
||||||
/// filter out the warnings in m_warningsToFilter or all warnings and infos if _includeWarningsAndInfos is false
|
/// filter out the warnings in m_warningsToFilter or all warnings and infos if _includeWarningsAndInfos is false
|
||||||
langutil::ErrorList filterErrors(langutil::ErrorList const& _errorList, bool _includeWarningsAndInfos = true) const;
|
langutil::ErrorList filterErrors(langutil::ErrorList const& _errorList, bool _includeWarningsAndInfos = true) const;
|
||||||
|
langutil::ErrorList filteredErrors(bool _includeWarningsAndInfos = true) const
|
||||||
|
{
|
||||||
|
return filterErrors(compiler().errors(), _includeWarningsAndInfos);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> m_warningsToFilter = {"This is a pre-release compiler version"};
|
std::vector<std::string> m_warningsToFilter = {"This is a pre-release compiler version"};
|
||||||
std::vector<std::string> m_messagesToCut = {"Source file requires different compiler version (current compiler is"};
|
std::vector<std::string> m_messagesToCut = {"Source file requires different compiler version (current compiler is"};
|
||||||
|
@ -116,7 +116,7 @@ void SyntaxTest::parseAndAnalyze()
|
|||||||
|
|
||||||
void SyntaxTest::filterObtainedErrors()
|
void SyntaxTest::filterObtainedErrors()
|
||||||
{
|
{
|
||||||
for (auto const& currentError: filterErrors(compiler().errors(), true))
|
for (auto const& currentError: filteredErrors())
|
||||||
{
|
{
|
||||||
int locationStart = -1;
|
int locationStart = -1;
|
||||||
int locationEnd = -1;
|
int locationEnd = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user