void (@NotNull PyCaseClause clause) { PyPattern pattern = clause.getPattern(); if (pattern != null) { processPattern(pattern); retargetOutgoingPatternEdges(pattern, (oldScope, instr) -> { return instr.isMatched() ? pattern : clause; }); } PyStatementList statementList = clause.getStatementList(); PyExpression guard = clause.getGuardCondition(); if (guard != null) { guard.accept(myBaseVisitor); // Retarget failure edges coming from inner OR and AND expressions retargetOutgoingEdges(guard, (pendingScope, instr) -> { if (instr instanceof ConditionalInstruction && !((ConditionalInstruction)instr).getResult()) { return clause; } return pendingScope; }); // Top-level OR and AND expressions should have had their own outgoing failure edges if (!isConjunctionOrDisjunction(guard)) { myBuilder.addPendingEdge(clause, myBuilder.prevInstruction); } myBuilder.startConditionalNode(statementList, guard, true); } statementList.accept(myBaseVisitor); PyMatchStatement matchStatement = PsiTreeUtil.getParentOfType(clause, PyMatchStatement.class); assert matchStatement != null; retargetOutgoingEdges(statementList, (pendingScope, instruction) -> matchStatement); myBuilder.addPendingEdge(matchStatement, myBuilder.prevInstruction); myBuilder.prevInstruction = null; }