if (v instanceof Expr) {
Expr expr = (Expr) v;
v = expr.value;
}
if (v instanceof ImportFrom) {
ImportFrom f = (ImportFrom) v;
FindLastLineVisitor findLastLineVisitor = new FindLastLineVisitor();
try {
f.accept(findLastLineVisitor);
SimpleNode lastNode = findLastLineVisitor.getLastNode();
ISpecialStr lastSpecialStr = findLastLineVisitor.getLastSpecialStr();
if (lastSpecialStr != null && lastSpecialStr.toString().equals(")")) {
//it was an from xxx import (euheon, utehon)
return lastSpecialStr.getBeginLine();
} else {
return lastNode.beginLine;
}
} catch (Exception e) {
Log.log(e);
}
}
if (v instanceof Import) {
Import f = (Import) v;
FindLastLineVisitor findLastLineVisitor = new FindLastLineVisitor();
try {
f.accept(findLastLineVisitor);
SimpleNode lastNode = findLastLineVisitor.getLastNode();
return lastNode.beginLine;
} catch (Exception e) {
Log.log(e);
}