properly deallocating the prefix obeject

This commit is contained in:
Karma Riuk
2025-07-11 09:01:09 +02:00
parent c55c6b2b20
commit ed3cf748e2
2 changed files with 5 additions and 0 deletions

View File

@@ -16,4 +16,8 @@ namespace ast {
std::string prefix_expr::str() const { std::string prefix_expr::str() const {
return token.literal + right->str(); return token.literal + right->str();
} }
prefix_expr::~prefix_expr() {
delete right;
};
} // namespace ast } // namespace ast

View File

@@ -12,5 +12,6 @@ namespace ast {
std::string token_literal() const override; std::string token_literal() const override;
std::string str() const override; std::string str() const override;
~prefix_expr();
}; };
} // namespace ast } // namespace ast