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 {
|
std::string prefix_expr::str() const {
|
||||||
return token.literal + right->str();
|
return "(" + op + right->str() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix_expr::~prefix_expr() {
|
prefix_expr::~prefix_expr() {
|
||||||
|
@@ -22,8 +22,6 @@ namespace ast {
|
|||||||
if (expression != nullptr)
|
if (expression != nullptr)
|
||||||
ss << expression->str();
|
ss << expression->str();
|
||||||
|
|
||||||
ss << ';';
|
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
};
|
};
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
Reference in New Issue
Block a user