visitor base fixes & print visitor fix started

This commit is contained in:
ProgramSnail 2023-04-25 14:59:14 +03:00
parent c6c2a00e04
commit fd047bc517
3 changed files with 28 additions and 3 deletions

View file

@ -253,7 +253,7 @@ void PrintVisitor::Visit(AnyAnnotatedType* node) {
if (!node->typeclasses.empty()) {
out_ << " (";
for (auto& typeclass : node->typeclasses) {
Visitor::Visit(typeclass);
Visit(typeclass.get());
}
out_ << ')';
}
@ -276,6 +276,20 @@ void PrintVisitor::Visit(MatchCase* node) {
out_ << "]\n";
}
void PrintVisitor::Visit(MatchCase* node) {
out_ << "[MatchCase | ";
Visitor::Visit(node->value);
if (node->condition.has_value()) {
out_ << " ? ";
Visitor::Visit(node->condition.value());
}
if (node->statement.has_value()) {
out_ << " -> ";
Visitor::Visit(node->statement.value());
}
out_ << "]\n";
}
void PrintVisitor::Visit(Match* node) {
out_ << "[Match] (";
Visitor::Visit(node->value);