Support for if ... then ... else following #911. (#944)

This commit is contained in:
Richard Smith
2022-03-03 16:34:34 -08:00
committed by GitHub
parent 4a98acc3ea
commit 2325c50b3b
9 changed files with 113 additions and 3 deletions
+7
View File
@@ -187,6 +187,13 @@ void Expression::Print(llvm::raw_ostream& out) const {
}
out << ")";
break;
case ExpressionKind::IfExpression: {
const auto& if_expr = cast<IfExpression>(*this);
out << "if " << *if_expr.condition() << " then "
<< *if_expr.then_expression() << " else "
<< *if_expr.else_expression();
break;
}
case ExpressionKind::UnimplementedExpression: {
const auto& unimplemented = cast<UnimplementedExpression>(*this);
out << "UnimplementedExpression<" << unimplemented.label() << ">(";