diff options
-rw-r--r-- | liblll/Exceptions.h | 1 | ||||
-rw-r--r-- | liblll/Parser.cpp | 5 | ||||
-rw-r--r-- | liblll/Parser.h | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/liblll/Exceptions.h b/liblll/Exceptions.h index 1e9671b3..aa4bf4e8 100644 --- a/liblll/Exceptions.h +++ b/liblll/Exceptions.h @@ -39,6 +39,7 @@ class InvalidName: public CompilerException {}; class InvalidMacroArgs: public CompilerException {}; class InvalidLiteral: public CompilerException {}; class BareSymbol: public CompilerException {}; +class ParserException: public CompilerException {}; } } diff --git a/liblll/Parser.cpp b/liblll/Parser.cpp index aa4a4de2..daced13c 100644 --- a/liblll/Parser.cpp +++ b/liblll/Parser.cpp @@ -143,7 +143,8 @@ void dev::eth::parseTreeLLL(string const& _s, sp::utree& o_out) auto ret = s.cbegin(); qi::phrase_parse(ret, s.cend(), element, space, qi::skip_flag::dont_postskip, o_out); for (auto i = ret; i != s.cend(); ++i) - if (!isspace(*i)) - BOOST_THROW_EXCEPTION(std::exception()); + if (!isspace(*i)) { + BOOST_THROW_EXCEPTION(ParserException() << errinfo_comment("Non-whitespace left in parser")); + } } diff --git a/liblll/Parser.h b/liblll/Parser.h index b21989f0..e4542888 100644 --- a/liblll/Parser.h +++ b/liblll/Parser.h @@ -24,6 +24,7 @@ #include <string> #include <vector> #include <libdevcore/Common.h> +#include "Exceptions.h" namespace boost { namespace spirit { class utree; } } namespace sp = boost::spirit; |