mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
to make sure CFG for bad code is built correctly, visit raw targets of assignment
This commit is contained in:
@@ -144,7 +144,7 @@ public class PyControlFlowBuilder extends PyRecursiveElementVisitor {
|
||||
if (value != null) {
|
||||
value.accept(this);
|
||||
}
|
||||
for (PyExpression expression : node.getTargets()) {
|
||||
for (PyExpression expression : node.getRawTargets()) {
|
||||
expression.accept(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ x for x in (1, 2) } = 5
|
||||
@@ -0,0 +1,9 @@
|
||||
0(1) element: null
|
||||
1(2) element: PyAssignmentStatement
|
||||
2(3) element: PySetCompExpression
|
||||
3(4,8) element: PyParenthesizedExpression
|
||||
4(5) element: PyTargetExpression: x
|
||||
5(6) WRITE ACCESS: x
|
||||
6(7) element: PyReferenceExpression: x
|
||||
7(4,8) READ ACCESS: x
|
||||
8() element: null
|
||||
@@ -170,6 +170,10 @@ public class PyControlFlowBuilderTest extends LightMarkedTestCase {
|
||||
doTestFirstStatement();
|
||||
}
|
||||
|
||||
public void testSetComprehension() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testQualifiedSelfReference() {
|
||||
final String testName = getTestName(false).toLowerCase();
|
||||
configureByFile(testName + ".py");
|
||||
|
||||
Reference in New Issue
Block a user