diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-02-20 19:27:39 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-02-21 05:51:16 +0800 |
commit | 858acaa1937ccc2f6cc13bb3076abc32c43789b0 (patch) | |
tree | 6628fd9080584e7dbae13272a00aee9a2357df1a /AST_accept.h | |
parent | 1ed86b33bcb07f432209953ec4ed1779d0831452 (diff) | |
download | dexon-solidity-858acaa1937ccc2f6cc13bb3076abc32c43789b0.tar dexon-solidity-858acaa1937ccc2f6cc13bb3076abc32c43789b0.tar.gz dexon-solidity-858acaa1937ccc2f6cc13bb3076abc32c43789b0.tar.bz2 dexon-solidity-858acaa1937ccc2f6cc13bb3076abc32c43789b0.tar.lz dexon-solidity-858acaa1937ccc2f6cc13bb3076abc32c43789b0.tar.xz dexon-solidity-858acaa1937ccc2f6cc13bb3076abc32c43789b0.tar.zst dexon-solidity-858acaa1937ccc2f6cc13bb3076abc32c43789b0.zip |
corrected accept for variableDeclaration
changes after code review
Diffstat (limited to 'AST_accept.h')
-rw-r--r-- | AST_accept.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/AST_accept.h b/AST_accept.h index 217a565f..b1577ecd 100644 --- a/AST_accept.h +++ b/AST_accept.h @@ -196,17 +196,24 @@ void FunctionDefinition::accept(ASTConstVisitor& _visitor) const void VariableDeclaration::accept(ASTVisitor& _visitor) { if (_visitor.visit(*this)) + { if (m_typeName) m_typeName->accept(_visitor); + if (m_value) + m_value->accept(_visitor); + } _visitor.endVisit(*this); } void VariableDeclaration::accept(ASTConstVisitor& _visitor) const { if (_visitor.visit(*this)) + { if (m_typeName) m_typeName->accept(_visitor); - _visitor.endVisit(*this); + if (m_value) + m_value->accept(_visitor); + } } void ModifierDefinition::accept(ASTVisitor& _visitor) @@ -478,22 +485,14 @@ void ExpressionStatement::accept(ASTConstVisitor& _visitor) const void VariableDeclarationStatement::accept(ASTVisitor& _visitor) { if (_visitor.visit(*this)) - { m_variable->accept(_visitor); - if (m_variable->getValue()) - m_variable->getValue()->accept(_visitor); - } _visitor.endVisit(*this); } void VariableDeclarationStatement::accept(ASTConstVisitor& _visitor) const { if (_visitor.visit(*this)) - { m_variable->accept(_visitor); - if (m_variable->getValue()) - m_variable->getValue()->accept(_visitor); - } _visitor.endVisit(*this); } |