2014-12-17 15:23:18 +00:00
|
|
|
/*
|
2016-11-18 23:13:20 +00:00
|
|
|
This file is part of solidity.
|
2014-12-17 15:23:18 +00:00
|
|
|
|
2016-11-18 23:13:20 +00:00
|
|
|
solidity is free software: you can redistribute it and/or modify
|
2014-12-17 15:23:18 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
2016-11-18 23:13:20 +00:00
|
|
|
solidity is distributed in the hope that it will be useful,
|
2014-12-17 15:23:18 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2016-11-18 23:13:20 +00:00
|
|
|
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
2014-12-17 15:23:18 +00:00
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @author Christian <c@ethdev.com>
|
|
|
|
* @date 2014
|
|
|
|
* Solidity Utilities.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-03-18 14:31:16 +00:00
|
|
|
#include <libdevcore/Assertions.h>
|
2015-10-20 22:21:52 +00:00
|
|
|
#include <libsolidity/interface/Exceptions.h>
|
2015-10-15 09:50:25 +00:00
|
|
|
|
|
|
|
namespace dev
|
|
|
|
{
|
|
|
|
namespace solidity
|
|
|
|
{
|
|
|
|
struct InternalCompilerError;
|
2016-11-14 20:41:58 +00:00
|
|
|
struct UnimplementedFeatureError;
|
2015-10-15 09:50:25 +00:00
|
|
|
}
|
|
|
|
}
|
2014-12-17 15:23:18 +00:00
|
|
|
|
|
|
|
/// Assertion that throws an InternalCompilerError containing the given description if it is not met.
|
|
|
|
#define solAssert(CONDITION, DESCRIPTION) \
|
2015-03-18 14:31:16 +00:00
|
|
|
assertThrow(CONDITION, ::dev::solidity::InternalCompilerError, DESCRIPTION)
|
2015-01-13 10:18:08 +00:00
|
|
|
|
2016-11-14 20:41:58 +00:00
|
|
|
#define solUnimplementedAssert(CONDITION, DESCRIPTION) \
|
|
|
|
assertThrow(CONDITION, ::dev::solidity::UnimplementedFeatureError, DESCRIPTION)
|
|
|
|
|
|
|
|
#define solUnimplemented(DESCRIPTION) \
|
|
|
|
solUnimplementedAssert(false, DESCRIPTION)
|