diff --git a/liblll/Exceptions.h b/liblll/Exceptions.h index 1e9671b36..aa4bf4e82 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 aa4a4de24..daced13c1 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 b21989f06..e45428882 100644 --- a/liblll/Parser.h +++ b/liblll/Parser.h @@ -24,6 +24,7 @@ #include #include #include +#include "Exceptions.h" namespace boost { namespace spirit { class utree; } } namespace sp = boost::spirit;