aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-26 23:14:40 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-29 04:46:16 +0800
commit53ef6900b797cde404faac94af3058669187c115 (patch)
tree879c5fecf54328b03c21c57f4bf6e85bf09c79bd /AST.h
parentb95048768dbb64fc7d14eb93bdaad7c85b74e7c8 (diff)
downloaddexon-solidity-53ef6900b797cde404faac94af3058669187c115.tar
dexon-solidity-53ef6900b797cde404faac94af3058669187c115.tar.gz
dexon-solidity-53ef6900b797cde404faac94af3058669187c115.tar.bz2
dexon-solidity-53ef6900b797cde404faac94af3058669187c115.tar.lz
dexon-solidity-53ef6900b797cde404faac94af3058669187c115.tar.xz
dexon-solidity-53ef6900b797cde404faac94af3058669187c115.tar.zst
dexon-solidity-53ef6900b797cde404faac94af3058669187c115.zip
Adding isStateVariable attribute to a VarDecl
Diffstat (limited to 'AST.h')
-rwxr-xr-xAST.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/AST.h b/AST.h
index d9a95e50..d769aa22 100755
--- a/AST.h
+++ b/AST.h
@@ -430,8 +430,8 @@ class VariableDeclaration: public Declaration
{
public:
VariableDeclaration(Location const& _location, ASTPointer<TypeName> const& _type,
- ASTPointer<ASTString> const& _name, bool _isPublic):
- Declaration(_location, _name), m_typeName(_type), m_isPublic(_isPublic) {}
+ ASTPointer<ASTString> const& _name, bool _isPublic, bool _isStateVar = false):
+ Declaration(_location, _name), m_typeName(_type), m_isPublic(_isPublic), m_isStateVariable(_isStateVar) {}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
@@ -445,11 +445,13 @@ public:
virtual LValueType getLValueType() const override;
bool isLocalVariable() const { return !!dynamic_cast<FunctionDefinition const*>(getScope()); }
bool isPublic() const { return m_isPublic; }
+ bool isStateVariable() const { return m_isStateVariable; }
private:
ASTPointer<TypeName> m_typeName; ///< can be empty ("var")
bool m_isPublic; ///< Whether there is an accessor for it or not
+ bool m_isStateVariable; ///< Whether or not this is a contract state variable
std::shared_ptr<Type const> m_type; ///< derived type, initially empty
};