aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/AST.h
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-09-07 00:59:50 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-09-11 20:52:23 +0800
commit1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f (patch)
tree258433cfc4c6fced543ba9cf968995e09438c851 /libsolidity/ast/AST.h
parent7d5c13981623f5f931444d227b163d9b0d995fd8 (diff)
downloaddexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar.gz
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar.bz2
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar.lz
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar.xz
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.tar.zst
dexon-solidity-1ce3581a522a94d9e9a4a84cf8cb63f626e1a14f.zip
Accept ``address payable`` during parsing.
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r--libsolidity/ast/AST.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h
index a5cd277d..f3464f92 100644
--- a/libsolidity/ast/AST.h
+++ b/libsolidity/ast/AST.h
@@ -876,23 +876,31 @@ public:
};
/**
- * Any pre-defined type name represented by a single keyword, i.e. it excludes mappings,
- * contracts, functions, etc.
+ * Any pre-defined type name represented by a single keyword (and possibly a state mutability for address types),
+ * i.e. it excludes mappings, contracts, functions, etc.
*/
class ElementaryTypeName: public TypeName
{
public:
- ElementaryTypeName(SourceLocation const& _location, ElementaryTypeNameToken const& _elem):
- TypeName(_location), m_type(_elem)
- {}
+ ElementaryTypeName(
+ SourceLocation const& _location,
+ ElementaryTypeNameToken const& _elem,
+ boost::optional<StateMutability> _stateMutability = {}
+ ): TypeName(_location), m_type(_elem), m_stateMutability(_stateMutability)
+ {
+ solAssert(!_stateMutability.is_initialized() || _elem.token() == Token::Address, "");
+ }
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
ElementaryTypeNameToken const& typeName() const { return m_type; }
+ boost::optional<StateMutability> const& stateMutability() const { return m_stateMutability; }
+
private:
ElementaryTypeNameToken m_type;
+ boost::optional<StateMutability> m_stateMutability; ///< state mutability for address type
};
/**