if (expression.endsWithComma()) {
complete = true;
}
int lastIndex = expression.childrenSize() - 1;
AbstractExpression child = (AbstractExpression) expression.getChild(lastIndex);
// The collection ends with an empty element, that's not complete
if (isNull(child)) {
complete = false;
}
else {
int length = expression.toActualText(positionInCollections.peek()).length();
// The position is at the beginning of the child expression, that means
// it's complete because we don't have to verify the child expression
if (corrections.peek() == length) {
int index = Math.max(0, positionInCollections.peek() - 1);
complete = expression.hasComma(index);
}
// Dig into the child expression to check its status
else {
child.accept(this);
}
}
}