From 89b60ffbd4c2dde26fa5e9f1d750729b5c89373e Mon Sep 17 00:00:00 2001 From: Rhett Aultman Date: Thu, 11 May 2017 06:26:35 -0700 Subject: 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 --- libsolidity/analysis/SyntaxChecker.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libsolidity/analysis/SyntaxChecker.h') diff --git a/libsolidity/analysis/SyntaxChecker.h b/libsolidity/analysis/SyntaxChecker.h index 8d7dcdd3..b1857aa5 100644 --- a/libsolidity/analysis/SyntaxChecker.h +++ b/libsolidity/analysis/SyntaxChecker.h @@ -38,14 +38,11 @@ class SyntaxChecker: private ASTConstVisitor { public: /// @param _errors the reference to the list of errors and warnings to add them found during type checking. - SyntaxChecker(ErrorList& _errors): m_errors(_errors) {} + SyntaxChecker(ErrorReporter& _errorReporter): m_errorReporter(_errorReporter) {} bool checkSyntax(ASTNode const& _astRoot); private: - /// Adds a new error to the list of errors. - void warning(SourceLocation const& _location, std::string const& _description); - void syntaxError(SourceLocation const& _location, std::string const& _description); virtual bool visit(SourceUnit const& _sourceUnit) override; virtual void endVisit(SourceUnit const& _sourceUnit) override; @@ -66,7 +63,7 @@ private: virtual bool visit(PlaceholderStatement const& _placeholderStatement) override; - ErrorList& m_errors; + ErrorReporter& m_errorReporter; /// Flag that indicates whether a function modifier actually contains '_'. bool m_placeholderFound = false; -- cgit