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:
@@ -23,7 +23,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <libsolidity/interface/Exceptions.h>
|
||||
#include <libsolidity/ast/ASTAnnotations.h>
|
||||
|
||||
namespace dev
|
||||
@@ -31,12 +30,14 @@ namespace dev
|
||||
namespace solidity
|
||||
{
|
||||
|
||||
class ErrorReporter;
|
||||
|
||||
class DocStringParser
|
||||
{
|
||||
public:
|
||||
/// Parse the given @a _docString and stores the parsed components internally.
|
||||
/// @returns false on error and appends the error to @a _errors.
|
||||
bool parse(std::string const& _docString, ErrorList& _errors);
|
||||
bool parse(std::string const& _docString, ErrorReporter& _errorReporter);
|
||||
|
||||
std::multimap<std::string, DocTag> const& tags() const { return m_docTags; }
|
||||
|
||||
@@ -62,7 +63,7 @@ private:
|
||||
/// Mapping tag name -> content.
|
||||
std::multimap<std::string, DocTag> m_docTags;
|
||||
DocTag* m_lastTag = nullptr;
|
||||
ErrorList* m_errors = nullptr;
|
||||
ErrorReporter* m_errorReporter = nullptr;
|
||||
bool m_errorsOccurred = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user