aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-10-15 20:26:16 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-10-15 20:26:16 +0800
commit8aa50a004fb320b927b96576f085cfbe5f845da6 (patch)
treef9340978522d62a4d951a68c5085632425b968c4 /liblll
parent7c7a6de87b3c7b574a6bed25c7251df869532056 (diff)
downloaddexon-solidity-8aa50a004fb320b927b96576f085cfbe5f845da6.tar.gz
dexon-solidity-8aa50a004fb320b927b96576f085cfbe5f845da6.tar.zst
dexon-solidity-8aa50a004fb320b927b96576f085cfbe5f845da6.zip
LLL: throw proper ParserException
Diffstat (limited to 'liblll')
-rw-r--r--liblll/Exceptions.h1
-rw-r--r--liblll/Parser.cpp5
-rw-r--r--liblll/Parser.h1
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;