aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/DocStringParser.cpp
diff options
context:
space:
mode:
authorRhett Aultman <roadriverrail@gmail.com>2017-05-11 21:26:35 +0800
committerRhett Aultman <roadriverrail@gmail.com>2017-05-30 22:28:31 +0800
commit89b60ffbd4c2dde26fa5e9f1d750729b5c89373e (patch)
treea4c464d4d40baaa260f071c1028f347bd287e44d /libsolidity/parsing/DocStringParser.cpp
parent0066a08aa8f6c469cde7947ec50ca662a32123a0 (diff)
downloaddexon-solidity-89b60ffbd4c2dde26fa5e9f1d750729b5c89373e.tar.gz
dexon-solidity-89b60ffbd4c2dde26fa5e9f1d750729b5c89373e.tar.zst
dexon-solidity-89b60ffbd4c2dde26fa5e9f1d750729b5c89373e.zip
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
Diffstat (limited to 'libsolidity/parsing/DocStringParser.cpp')
-rw-r--r--libsolidity/parsing/DocStringParser.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/libsolidity/parsing/DocStringParser.cpp b/libsolidity/parsing/DocStringParser.cpp
index 8e912126..cd6c1d8a 100644
--- a/libsolidity/parsing/DocStringParser.cpp
+++ b/libsolidity/parsing/DocStringParser.cpp
@@ -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);
}