mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Restructured exceptions. Boost::exception is now used primarily.
This commit is contained in:
parent
55d0e1c34e
commit
f61c323244
@ -102,7 +102,7 @@ void Assembly::append(Assembly const& _a)
|
|||||||
void Assembly::append(Assembly const& _a, int _deposit)
|
void Assembly::append(Assembly const& _a, int _deposit)
|
||||||
{
|
{
|
||||||
if (_deposit > _a.m_deposit)
|
if (_deposit > _a.m_deposit)
|
||||||
throw InvalidDeposit();
|
BOOST_THROW_EXCEPTION(InvalidDeposit());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
append(_a);
|
append(_a);
|
||||||
|
@ -111,7 +111,7 @@ public:
|
|||||||
std::ostream& streamOut(std::ostream& _out, std::string const& _prefix = "") const;
|
std::ostream& streamOut(std::ostream& _out, std::string const& _prefix = "") const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) throw InvalidDeposit(); }
|
void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) BOOST_THROW_EXCEPTION(InvalidDeposit()); }
|
||||||
unsigned bytesRequired() const;
|
unsigned bytesRequired() const;
|
||||||
|
|
||||||
unsigned m_usedTags = 0;
|
unsigned m_usedTags = 0;
|
||||||
|
@ -50,7 +50,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void finalise(CompilerState const& _cs);
|
void finalise(CompilerState const& _cs);
|
||||||
|
|
||||||
template <class T> void error() const { throw T(); }
|
template <class T> void error() const { BOOST_THROW_EXCEPTION(T() ); }
|
||||||
void constructOperation(sp::utree const& _t, CompilerState& _s);
|
void constructOperation(sp::utree const& _t, CompilerState& _s);
|
||||||
|
|
||||||
bool m_finalised = false;
|
bool m_finalised = false;
|
||||||
|
@ -43,7 +43,10 @@ bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _error
|
|||||||
catch (Exception const& _e)
|
catch (Exception const& _e)
|
||||||
{
|
{
|
||||||
if (_errors)
|
if (_errors)
|
||||||
_errors->push_back(_e.description());
|
{
|
||||||
|
_errors->push_back("Parse error.");
|
||||||
|
_errors->push_back(diagnostic_information(_e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception)
|
catch (std::exception)
|
||||||
{
|
{
|
||||||
@ -67,7 +70,7 @@ std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::v
|
|||||||
catch (Exception const& _e)
|
catch (Exception const& _e)
|
||||||
{
|
{
|
||||||
if (_errors)
|
if (_errors)
|
||||||
_errors->push_back(_e.description());
|
_errors->push_back(diagnostic_information(_e));
|
||||||
}
|
}
|
||||||
catch (std::exception)
|
catch (std::exception)
|
||||||
{
|
{
|
||||||
|
@ -140,6 +140,6 @@ void dev::eth::parseTreeLLL(string const& _s, sp::utree& o_out)
|
|||||||
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))
|
||||||
throw std::exception();
|
BOOST_THROW_EXCEPTION(std::exception());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user