fixed the to string function of some nodes
This commit is contained in:
@@ -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() {
|
||||
|
@@ -22,8 +22,6 @@ namespace ast {
|
||||
if (expression != nullptr)
|
||||
ss << expression->str();
|
||||
|
||||
ss << ';';
|
||||
|
||||
return ss.str();
|
||||
};
|
||||
} // namespace ast
|
||||
|
Reference in New Issue
Block a user