fixed the to string function of some nodes

This commit is contained in:
Karma Riuk
2025-07-11 11:39:25 +02:00
parent 552e68169f
commit 7192bb318c
2 changed files with 1 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ namespace ast {
}
std::string prefix_expr::str() const {
return token.literal + right->str();
return "(" + op + right->str() + ")";
}
prefix_expr::~prefix_expr() {

View File

@@ -22,8 +22,6 @@ namespace ast {
if (expression != nullptr)
ss << expression->str();
ss << ';';
return ss.str();
};
} // namespace ast