aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/AST.h
diff options
context:
space:
mode:
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
};
/**