Remove the paren expression

Signed-off-by: CHatingPython <chatingpython@gmail.com>
This commit is contained in:
CHatingPython
2026-05-29 20:33:24 +02:00
committed by CHatingPython
parent b8b13d1635
commit 1fa9e50b57
4 changed files with 3 additions and 35 deletions
-9
View File
@@ -82,15 +82,6 @@ bool binop_expression_node::equal(const node& rhsNode) const {
return expression_node::equal(rhsNode) && m_type == rhs.m_type && m_lhs == rhs.m_lhs && m_rhs == rhs.m_rhs;
}
std::ostream& paren_expression_node::print(std::ostream& os) const {
return os << *m_node;
}
bool paren_expression_node::equal(const node& rhsNode) const {
const auto& rhs = reinterpret_cast<const paren_expression_node&>(rhsNode);
return expression_node::equal(rhsNode) && m_node == rhs.m_node;
}
bool declaration_node::equal(const node& rhs) const {
return declaration_type() == reinterpret_cast<const declaration_node&>(rhs).declaration_type();
}
+1 -1
View File
@@ -151,7 +151,7 @@ ast::expression_node_h parser::parse_expression_primary() {
auto node = parse_expression();
auto err = eat_token(token_t::Rparen);
if (err.has_error()) return err;
return ast::paren_expression_node_h{ tok.location(), m_arena, std::move(node) };
return node;
}
default: {
auto literal = parse_literal();