Skip to content

Commit

Permalink
add visitor walk for type in const and var declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
michael.burzan committed Jan 7, 2025
1 parent 140b658 commit b7ee5f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ast/ConstantDeclarationNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ConstantDeclarationNode::ConstantDeclarationNode(const std::string& var_name, co
void ConstantDeclarationNode::accept(const std::shared_ptr<Visitor>& v) {
v->begin(shared_from_this());
auto v_next = v->visit(shared_from_this());
_type->accept(v_next);
_expression->accept(v_next);
v->end(shared_from_this());
}
1 change: 1 addition & 0 deletions src/ast/VariableDeclarationNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ VariableDeclarationNode::VariableDeclarationNode(const std::string& var_name, co
void VariableDeclarationNode::accept(const std::shared_ptr<Visitor>& v) {
v->begin(shared_from_this());
auto v_next = v->visit(shared_from_this());
_type->accept(v_next);
_expression->accept(v_next);
v->end(shared_from_this());
}

0 comments on commit b7ee5f5

Please sign in to comment.