Files
interpreter-cpp/src/ast/expressions/prefix.cpp
2025-07-11 09:01:09 +02:00

24 lines
482 B
C++

#include "prefix.hpp"
#include "token/token.hpp"
namespace ast {
prefix_expr::prefix_expr(token::token token, std::string op)
: token(std::move(token)),
op(op),
right(nullptr) {}
std::string prefix_expr::token_literal() const {
return token.literal;
}
std::string prefix_expr::str() const {
return token.literal + right->str();
}
prefix_expr::~prefix_expr() {
delete right;
};
} // namespace ast