From b7ee5f5c789c3edf98bfa85083748ddab5f4eae9 Mon Sep 17 00:00:00 2001 From: "michael.burzan" Date: Tue, 7 Jan 2025 08:35:42 +0100 Subject: [PATCH] add visitor walk for type in const and var declaration --- src/ast/ConstantDeclarationNode.cpp | 1 + src/ast/VariableDeclarationNode.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ast/ConstantDeclarationNode.cpp b/src/ast/ConstantDeclarationNode.cpp index 35ca841..2fe2a9d 100644 --- a/src/ast/ConstantDeclarationNode.cpp +++ b/src/ast/ConstantDeclarationNode.cpp @@ -10,6 +10,7 @@ ConstantDeclarationNode::ConstantDeclarationNode(const std::string& var_name, co void ConstantDeclarationNode::accept(const std::shared_ptr& 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()); } diff --git a/src/ast/VariableDeclarationNode.cpp b/src/ast/VariableDeclarationNode.cpp index bd303bf..9c104ab 100644 --- a/src/ast/VariableDeclarationNode.cpp +++ b/src/ast/VariableDeclarationNode.cpp @@ -11,6 +11,7 @@ VariableDeclarationNode::VariableDeclarationNode(const std::string& var_name, co void VariableDeclarationNode::accept(const std::shared_ptr& 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()); }