diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-16 16:51:51 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-17 07:03:30 +0800 |
commit | 90e39c04d6e476491503573719c487744f529514 (patch) | |
tree | 0e307e5f4b3c5a85e4319b6167429bebed0ccbe4 /AST_accept.h | |
parent | 3f2600bb31a5a71ce4ebb4c2fa95762d68eb516b (diff) | |
download | dexon-solidity-90e39c04d6e476491503573719c487744f529514.tar.gz dexon-solidity-90e39c04d6e476491503573719c487744f529514.tar.zst dexon-solidity-90e39c04d6e476491503573719c487744f529514.zip |
Solidity ForStatements expressions are now optional
Diffstat (limited to 'AST_accept.h')
-rw-r--r-- | AST_accept.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/AST_accept.h b/AST_accept.h index ffef6f8b..0e5a71b6 100644 --- a/AST_accept.h +++ b/AST_accept.h @@ -271,9 +271,12 @@ void ForStatement::accept(ASTVisitor& _visitor) { if (_visitor.visit(*this)) { - m_initExpression->accept(_visitor); - m_condExpression->accept(_visitor); - m_loopExpression->accept(_visitor); + if (m_initExpression) + m_initExpression->accept(_visitor); + if (m_condExpression) + m_condExpression->accept(_visitor); + if (m_loopExpression) + m_loopExpression->accept(_visitor); m_body->accept(_visitor); } _visitor.endVisit(*this); @@ -283,9 +286,12 @@ void ForStatement::accept(ASTConstVisitor& _visitor) const { if (_visitor.visit(*this)) { - m_initExpression->accept(_visitor); - m_condExpression->accept(_visitor); - m_loopExpression->accept(_visitor); + if (m_initExpression) + m_initExpression->accept(_visitor); + if (m_condExpression) + m_condExpression->accept(_visitor); + if (m_loopExpression) + m_loopExpression->accept(_visitor); m_body->accept(_visitor); } _visitor.endVisit(*this); |