diff --git a/include/ast/expression/VariableDeclarationExpression.hpp b/include/ast/expression/VariableDeclarationExpression.hpp deleted file mode 100644 index ce4735a..0000000 --- a/include/ast/expression/VariableDeclarationExpression.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2024 - Nathanne Isip - * This file is part of Zhivo. - * - * Zhivo is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * Zhivo is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Zhivo. If not, see . - */ - -#ifndef ZHIVO_AST_EXPR_VAR_DECL_HPP -#define ZHIVO_AST_EXPR_VAR_DECL_HPP - -#include -#include -#include - -#include -#include - -class VariableDeclarationExpression : public ASTNode { -private: - std::unique_ptr name; - std::unique_ptr initializer; - -public: - explicit VariableDeclarationExpression( - std::unique_ptr _name, - std::unique_ptr _initializer - ) : name(std::move(_name)), - initializer(std::move(_initializer)) { - this->address = std::move(_name); - } - - [[nodiscard]] DynamicObject visit(SymbolTable& symbols) override; -}; - -#endif diff --git a/src/ast/expression/VariableDeclarationExpression.cpp b/src/ast/expression/VariableDeclarationExpression.cpp deleted file mode 100644 index bf26e37..0000000 --- a/src/ast/expression/VariableDeclarationExpression.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 - Nathanne Isip - * This file is part of Zhivo. - * - * Zhivo is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * Zhivo is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Zhivo. If not, see . - */ - -#include - -DynamicObject VariableDeclarationExpression::visit(SymbolTable& symbols) { - DynamicObject value = this->initializer->visit(symbols); - symbols.setSymbol(this->name->getImage(), value); - - return value; -}