Fixes PSI

This commit is contained in:
Oleg Shpynov
2010-03-11 18:54:38 +03:00
parent 0945a3afd4
commit 93d0d01bde
4 changed files with 21 additions and 1 deletions
@@ -58,7 +58,9 @@ public class PyAssignmentStatementImpl extends PyElementImpl implements PyAssign
List<PyExpression> candidates = PyUtil.flattenedParens(psi_nodes); // put all possible tuples to one level
List<PyExpression> targets = new ArrayList<PyExpression>();
for (PyExpression expr : candidates) { // only filter out targets
if (expr instanceof PyTargetExpression || expr instanceof PySubscriptionExpression) {
if (expr instanceof PyTargetExpression ||
expr instanceof PyReferenceExpression ||
expr instanceof PySubscriptionExpression) {
targets.add(expr);
}
}
@@ -0,0 +1,3 @@
sibling = []
if sibling:
sibling[0].text = 123
@@ -0,0 +1,11 @@
0(1) element: null
1(2) element: PyAssignmentStatement
2(3) WRITE ACCESS: sibling
3(4) element: PyIfStatement
4(5,10) READ ACCESS: sibling
5(6) element: PyStatementList. Condition: sibling:true
6(7) element: PyAssignmentStatement
7(8) element: PySubscriptionExpression
8(9) READ ACCESS: sibling
9(10) READ ACCESS: text
10() element: null
@@ -74,6 +74,10 @@ public class PyControlFlowBuilderTest extends LightMarkedTestCase {
doTest();
}
public void testAssignment2() throws Exception {
doTest();
}
public void testAugAssignment() throws Exception {
doTest();
}