void (final @NotNull PyComprehensionElement node) { PyExpression prevCondition = null; myBuilder.startNode(node); List<Instruction> iterators = new ArrayList<>(); for (PyComprehensionComponent component : node.getComponents()) { if (component instanceof PyComprehensionForComponent c) { final PyExpression iteratedList = c.getIteratedList(); final PyExpression iteratorVariable = c.getIteratorVariable(); if (prevCondition != null) { startConditionalNodeAndCheckGuards(iteratedList, prevCondition, true); prevCondition = null; } else { myBuilder.startNode(iteratedList); } iteratedList.accept(this); // for-loop continue and exit for (Instruction i : iterators) { myBuilder.addEdge(myBuilder.prevInstruction, i); } myBuilder.addPendingEdge(node, myBuilder.prevInstruction); final Instruction iterator = myBuilder.startNode(iteratorVariable); iteratorVariable.accept(this); // Inner "for" and "if" constructs will be linked to all outer iterators iterators.add(iterator); } else if (component instanceof PyComprehensionIfComponent c) { final PyExpression condition = c.getTest(); if (condition == null) { continue; } if (prevCondition != null) { startConditionalNodeAndCheckGuards(condition, prevCondition, true); } else { myBuilder.startNode(condition); } final PyTypeAssertionEvaluator assertionEvaluator = new PyTypeAssertionEvaluator(); condition.accept(this); condition.accept(assertionEvaluator); InstructionBuilder.addAssertInstructions(myBuilder, assertionEvaluator); // Condition is true for nested "for" and "if" constructs, next startNode() should create a conditional node prevCondition = condition; // for-loop continue and exit for (Instruction i : iterators) { myBuilder.addEdge(myBuilder.prevInstruction, i); } myBuilder.addPendingEdge(node, myBuilder.prevInstruction); } } final PyExpression result = node.getResultExpression(); if (result != null) { if (prevCondition != null) { startConditionalNodeAndCheckGuards(result, prevCondition, true); } else { myBuilder.startNode(result); } result.accept(this); // for-loop continue for (Instruction i : iterators) { myBuilder.addEdge(myBuilder.prevInstruction, i); } } }