properly deallocating the prefix obeject
This commit is contained in:
@@ -16,4 +16,8 @@ namespace ast {
|
||||
std::string prefix_expr::str() const {
|
||||
return token.literal + right->str();
|
||||
}
|
||||
|
||||
prefix_expr::~prefix_expr() {
|
||||
delete right;
|
||||
};
|
||||
} // namespace ast
|
||||
|
@@ -12,5 +12,6 @@ namespace ast {
|
||||
|
||||
std::string token_literal() const override;
|
||||
std::string str() const override;
|
||||
~prefix_expr();
|
||||
};
|
||||
} // namespace ast
|
||||
|
Reference in New Issue
Block a user