Change Match clauses from pairs to classes (#858)

Updates style of the Match class at the same time.
This commit is contained in:
Jon Meow
2021-09-29 13:36:54 -07:00
committed by GitHub
parent bf49f2efed
commit 25dce9fbcf
6 changed files with 57 additions and 43 deletions
+4 -4
View File
@@ -20,12 +20,12 @@ void Statement::PrintDepth(int depth, llvm::raw_ostream& out) const {
switch (Tag()) {
case Kind::Match: {
const auto& match = cast<Match>(*this);
out << "match (" << *match.Exp() << ") {";
out << "match (" << match.expression() << ") {";
if (depth < 0 || depth > 1) {
out << "\n";
for (auto& clause : match.Clauses()) {
out << "case " << *clause.first << " =>\n";
clause.second->PrintDepth(depth - 1, out);
for (auto& clause : match.clauses()) {
out << "case " << clause.pattern() << " =>\n";
clause.statement().PrintDepth(depth - 1, out);
out << "\n";
}
} else {