exprType expr = args.defaults[i];
if (expr != null) {
exprType name = params.get(i + diff);
if (name instanceof Name) {
removePositions.push(i + diff); //it's removed backwards, that's why it's a stack
keywords.add(new keywordType(new NameTok(((Name) name).id, NameTok.KeywordName), name, false));
} else {
Log.log("Expected: " + name + " to be a Name instance.");
}
}
}
while (removePositions.size() > 0) {
Integer pop = removePositions.pop();
params.remove((int) pop);
}
}
Call call;
if (isClassMethod && params.size() > 0) {
//We need to use the super() construct
//Something as:
//Expr[value=
// Call[func=
// Attribute[value=
// Call[func=Name[id=super, ctx=Load, reserved=false], args=[Name[id=Current, ctx=Load, reserved=false], Name[id=cls, ctx=Load, reserved=false]], keywords=[], starargs=null, kwargs=null],
// attr=NameTok[id=test, ctx=Attrib], ctx=Load],
// args=[], keywords=[], starargs=null, kwargs=null]
//]
exprType firstParam = params.remove(0);
Call innerCall = createCall("super", currentClassName, NodeUtils.getRepresentationString(firstParam));
Attribute attr = new Attribute(innerCall, new NameTok(NodeUtils.getRepresentationString(functionDef),
NameTok.Attrib), Attribute.Load);
call = new Call(attr, params.toArray(new Name[params.size()]), keywords.toArray(new keywordType[keywords
.size()]), starargs, kwargs);
} else {