aboutsummaryrefslogtreecommitdiffstats
path: root/AST_accept.h
diff options
context:
space:
mode:
Diffstat (limited to 'AST_accept.h')
-rw-r--r--AST_accept.h17
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);
}