aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2015-02-28 16:11:59 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2015-03-08 22:48:53 +0800
commit1efef53cb373788a7980c85d7d038649214ee0ba (patch)
treeff88e333d22e874073f68657aa95af8233704723 /AST.h
parent67ffc3db714bf1a4930a9e340e500285e985222f (diff)
downloaddexon-solidity-1efef53cb373788a7980c85d7d038649214ee0ba.tar.gz
dexon-solidity-1efef53cb373788a7980c85d7d038649214ee0ba.tar.zst
dexon-solidity-1efef53cb373788a7980c85d7d038649214ee0ba.zip
mark an identifier as callable if its next token is '('
Diffstat (limited to 'AST.h')
-rw-r--r--AST.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/AST.h b/AST.h
index eab53153..b21e505e 100644
--- a/AST.h
+++ b/AST.h
@@ -1134,8 +1134,8 @@ public:
class Identifier: public PrimaryExpression
{
public:
- Identifier(SourceLocation const& _location, ASTPointer<ASTString> const& _name):
- PrimaryExpression(_location), m_name(_name) {}
+ Identifier(SourceLocation const& _location, ASTPointer<ASTString> const& _name, bool _isCallable):
+ PrimaryExpression(_location), m_name(_name), m_isCallable(_isCallable) {}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
virtual void checkTypeRequirements() override;
@@ -1151,6 +1151,8 @@ public:
Declaration const* getReferencedDeclaration() const { return m_referencedDeclaration; }
ContractDefinition const* getCurrentContract() const { return m_currentContract; }
+ bool isCallable() const { return m_isCallable; }
+
private:
ASTPointer<ASTString> m_name;
@@ -1159,6 +1161,7 @@ private:
/// Stores a reference to the current contract. This is needed because types of base contracts
/// change depending on the context.
ContractDefinition const* m_currentContract = nullptr;
+ bool m_isCallable = false;
};
/**