mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 20:50:12 +01:00
Change Match clauses from pairs to classes (#858)
Updates style of the Match class at the same time.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user