mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
LLL: throw proper ParserException
This commit is contained in:
parent
7c7a6de87b
commit
8aa50a004f
@ -39,6 +39,7 @@ class InvalidName: public CompilerException {};
|
|||||||
class InvalidMacroArgs: public CompilerException {};
|
class InvalidMacroArgs: public CompilerException {};
|
||||||
class InvalidLiteral: public CompilerException {};
|
class InvalidLiteral: public CompilerException {};
|
||||||
class BareSymbol: public CompilerException {};
|
class BareSymbol: public CompilerException {};
|
||||||
|
class ParserException: public CompilerException {};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,8 @@ void dev::eth::parseTreeLLL(string const& _s, sp::utree& o_out)
|
|||||||
auto ret = s.cbegin();
|
auto ret = s.cbegin();
|
||||||
qi::phrase_parse(ret, s.cend(), element, space, qi::skip_flag::dont_postskip, o_out);
|
qi::phrase_parse(ret, s.cend(), element, space, qi::skip_flag::dont_postskip, o_out);
|
||||||
for (auto i = ret; i != s.cend(); ++i)
|
for (auto i = ret; i != s.cend(); ++i)
|
||||||
if (!isspace(*i))
|
if (!isspace(*i)) {
|
||||||
BOOST_THROW_EXCEPTION(std::exception());
|
BOOST_THROW_EXCEPTION(ParserException() << errinfo_comment("Non-whitespace left in parser"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <libdevcore/Common.h>
|
#include <libdevcore/Common.h>
|
||||||
|
#include "Exceptions.h"
|
||||||
|
|
||||||
namespace boost { namespace spirit { class utree; } }
|
namespace boost { namespace spirit { class utree; } }
|
||||||
namespace sp = boost::spirit;
|
namespace sp = boost::spirit;
|
||||||
|
Loading…
Reference in New Issue
Block a user