if (foundAsDefinition && !scope.equals(definitionFound.scope)) { //if it is found as a definition it is an 'exact' match, so, we do not keep checking it
return null;
}
for (int i = 0; i < node.targets.length; i++) {
exprType target = node.targets[i];
if (target instanceof Subscript) {
continue; //assigning to an element and not the variable itself. E.g.: mydict[1] = 10 (instead of mydict = 10)
}
if (target instanceof Tuple) {
//if assign is xxx, yyy = 1, 2
//let's separate those as different assigns and analyze one by one
Tuple targetTuple = (Tuple) target;
if (node.value instanceof Tuple) {
Tuple valueTuple = (Tuple) node.value;
checkTupleAssignTarget(targetTuple, valueTuple.elts);
} else if (node.value instanceof org.python.pydev.parser.jython.ast.List) {
org.python.pydev.parser.jython.ast.List valueList = (org.python.pydev.parser.jython.ast.List) node.value;
checkTupleAssignTarget(targetTuple, valueList.elts);
} else {
checkTupleAssignTarget(targetTuple, new exprType[] { node.value });
}
} else {
String rep = NodeUtils.getFullRepresentationString(target);
if (tokenToFind.equals(rep)) { //note, order of equals is important (because one side may be null).
exprType nodeValue = node.value;
String value = NodeUtils.getFullRepresentationString(nodeValue);
if (value == null) {
value = "";
}