return result;
}
private Result executeLoop(Session session) {
Result result = Result.updateZeroResult;
while (true) {
if (type == StatementTypes.WHILE) {
result = condition.execute(session);
if (result.isError()) {
break;
}
if (!Boolean.TRUE.equals(result.getValueObject())) {
result = Result.updateZeroResult;
break;
}
}
for (int i = 0; i < statements.length; i++) {
result = statements[i].execute(session);
if (result.isError()) {
break;
}
if (result.getType() == ResultConstants.VALUE) {
break;
}
}
if (result.isError()) {
break;
}
if (result.getType() == ResultConstants.VALUE) {
if (result.getErrorCode() == StatementTypes.ITERATE) {
if (result.getMainString() == null) {
continue;
}
if (label != null
&& label.name.equals(result.getMainString())) {
continue;
}
break;
}
if (result.getErrorCode() == StatementTypes.LEAVE) {
if (result.getMainString() == null) {
result = Result.updateZeroResult;
}
if (label != null
&& label.name.equals(result.getMainString())) {
result = Result.updateZeroResult;
}
break;
}
if (result.getErrorCode() == StatementTypes.RETURN) {
break;
}
}
if (type == StatementTypes.REPEAT) {
result = condition.execute(session);
if (result.isError()) {
break;
}
if (Boolean.TRUE.equals(result.getValueObject())) {
result = Result.updateZeroResult;
break;
}
}