aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2014-10-25 01:17:08 +0800
committerGav Wood <g@ethdev.com>2014-10-25 01:17:08 +0800
commitc6e0f82d2ebcbb77a24a287767d81674f78c62d7 (patch)
tree508c872a937f13b9a2900bf39181c7833793ee84 /AST.h
parent987f42aa38bd51b612436425af4f4a0fdf0416c4 (diff)
parent2a24c3d8109d34cea6e47de77f519565e42c60fe (diff)
downloaddexon-solidity-c6e0f82d2ebcbb77a24a287767d81674f78c62d7.tar
dexon-solidity-c6e0f82d2ebcbb77a24a287767d81674f78c62d7.tar.gz
dexon-solidity-c6e0f82d2ebcbb77a24a287767d81674f78c62d7.tar.bz2
dexon-solidity-c6e0f82d2ebcbb77a24a287767d81674f78c62d7.tar.lz
dexon-solidity-c6e0f82d2ebcbb77a24a287767d81674f78c62d7.tar.xz
dexon-solidity-c6e0f82d2ebcbb77a24a287767d81674f78c62d7.tar.zst
dexon-solidity-c6e0f82d2ebcbb77a24a287767d81674f78c62d7.zip
Merge pull request #410 from chriseth/sol_exceptions
Improved exceptions and reporting exceptions for command-line compiler.
Diffstat (limited to 'AST.h')
-rw-r--r--AST.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/AST.h b/AST.h
index d5e1e066..df146ab1 100644
--- a/AST.h
+++ b/AST.h
@@ -22,16 +22,16 @@
#pragma once
-#include <boost/noncopyable.hpp>
#include <string>
#include <vector>
#include <memory>
-
+#include <boost/noncopyable.hpp>
#include <libsolidity/ASTForward.h>
#include <libsolidity/BaseTypes.h>
#include <libsolidity/Token.h>
#include <libsolidity/Types.h>
+#include <libsolidity/Exceptions.h>
namespace dev
{
@@ -57,6 +57,10 @@ public:
Location const& getLocation() const { return m_location; }
+ /// Creates a @ref TypeError exception and decorates it with the location of the node and
+ /// the given description
+ TypeError createTypeError(std::string const& _description);
+
private:
Location m_location;
};
@@ -165,7 +169,7 @@ public:
Declaration(_location, _name), m_typeName(_type) {}
virtual void accept(ASTVisitor& _visitor) override;
- bool isTypeGivenExplicitly() const { return m_typeName.get() != nullptr; }
+ bool isTypeGivenExplicitly() const { return bool(m_typeName); }
TypeName* getTypeName() const { return m_typeName.get(); }
//! Returns the declared or inferred type. Can be an empty pointer if no type was explicitly