void Resolver::visit(MatchExpr& expr, int dummy) { // Resolve the value. resolve(expr.value()); // Resolve each case. for (int i = 0; i < expr.cases().count(); i++) { Scope caseScope(this); const MatchClause& clause = expr.cases()[i]; // Resolve the pattern (will be null for the else case). if (!clause.pattern().isNull()) { scope_->resolve(*clause.pattern()); } // Resolve the body. resolve(clause.body()); caseScope.end(); } }
void ExprCompiler::visit(MatchExpr& expr, int dest) { compile(expr.value(), dest); compileMatch(expr.cases(), dest); }