diff options
author | Rhett Aultman <roadriverrail@gmail.com> | 2017-05-11 21:26:35 +0800 |
---|---|---|
committer | Rhett Aultman <roadriverrail@gmail.com> | 2017-05-30 22:28:31 +0800 |
commit | 89b60ffbd4c2dde26fa5e9f1d750729b5c89373e (patch) | |
tree | a4c464d4d40baaa260f071c1028f347bd287e44d /libsolidity/parsing/ParserBase.cpp | |
parent | 0066a08aa8f6c469cde7947ec50ca662a32123a0 (diff) | |
download | dexon-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/ParserBase.cpp')
-rw-r--r-- | libsolidity/parsing/ParserBase.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libsolidity/parsing/ParserBase.cpp b/libsolidity/parsing/ParserBase.cpp index ac103bda..9987b82c 100644 --- a/libsolidity/parsing/ParserBase.cpp +++ b/libsolidity/parsing/ParserBase.cpp @@ -22,6 +22,7 @@ #include <libsolidity/parsing/ParserBase.h> #include <libsolidity/parsing/Scanner.h> +#include <libsolidity/interface/ErrorReporter.h> using namespace std; using namespace dev; @@ -82,16 +83,10 @@ void ParserBase::expectToken(Token::Value _value) void ParserBase::parserError(string const& _description) { - auto err = make_shared<Error>(Error::Type::ParserError); - *err << - errinfo_sourceLocation(SourceLocation(position(), position(), sourceName())) << - errinfo_comment(_description); - - m_errors.push_back(err); + m_errorReporter.parserError(SourceLocation(position(), position(), sourceName()), _description); } void ParserBase::fatalParserError(string const& _description) { - parserError(_description); - BOOST_THROW_EXCEPTION(FatalError()); + m_errorReporter.fatalParserError(SourceLocation(position(), position(), sourceName()), _description); } |