mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Refactor error reporting
This commit introduces ErrorReporter, a utility class which consolidates all of the error logging functionality into a common set of functions. It also replaces all direct interactions with an ErrorList with calls to an ErrorReporter. This commit resolves issue #2209
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
#include <libsolidity/parsing/DocStringParser.h>
|
||||
#include <libsolidity/interface/ErrorReporter.h>
|
||||
#include <libsolidity/interface/Utils.h>
|
||||
|
||||
#include <boost/range/irange.hpp>
|
||||
@@ -51,9 +52,9 @@ string::const_iterator skipWhitespace(
|
||||
|
||||
}
|
||||
|
||||
bool DocStringParser::parse(string const& _docString, ErrorList& _errors)
|
||||
bool DocStringParser::parse(string const& _docString, ErrorReporter& _errorReporter)
|
||||
{
|
||||
m_errors = &_errors;
|
||||
m_errorReporter = &_errorReporter;
|
||||
m_errorsOccurred = false;
|
||||
m_lastTag = nullptr;
|
||||
|
||||
@@ -172,8 +173,6 @@ void DocStringParser::newTag(string const& _tagName)
|
||||
|
||||
void DocStringParser::appendError(string const& _description)
|
||||
{
|
||||
auto err = make_shared<Error>(Error::Type::DocstringParsingError);
|
||||
*err << errinfo_comment(_description);
|
||||
m_errors->push_back(err);
|
||||
m_errorsOccurred = true;
|
||||
m_errorReporter->docstringParsingError(_description);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user