// Rules always just consists of RuleElements: whitespace separation
if (s.sourceEnd() - s.sourceStart() > 2 * maxLineLength) {
inLargeRule = 1;
indentLevel++;
}
RutaRule rule = (RutaRule) s;
List<Expression> expressions = rule.getExpressions();
if (expressions != null && !expressions.isEmpty()) {
append(expressions.get(0));
append(" " + THEN + " ");
if (expressions.size() > 1) {
for (int i = 1; i < expressions.size(); i++) {
Expression expression = expressions.get(i);
if (expression.getKind() == RutaTypeConstants.RUTA_TYPE_N && i < expressions.size() - 1) {
append(expression);
append(EQUALS);
append(expressions.get(++i));
} else {
append(expression);
}
if (i < expressions.size() - 1) {
append(COMMA + " ");
}
}
}
}
if (!inBlockDeclaration) {
appendStatementEnd();
}
if (inLargeRule > 0) {
indentLevel--;
inLargeRule = 0;
}
return false;
}
if (s instanceof RutaRule) {
// traverse into container RutaRule to format RuleElements
if (!inBlockDeclaration) {
appendNewLine();
}
// Rules always just consists of RuleElements: whitespace separation
if (s.sourceEnd() - s.sourceStart() > 2 * maxLineLength) {
inLargeRule = 1;
indentLevel++;
}
RutaRule rule = (RutaRule) s;
List<Expression> expressions = rule.getExpressions();
String sep = "";
traverseAstNodes(expressions, sep);
if (!inBlockDeclaration) {
appendStatementEnd();
}