visitAllObjects<T> method
void
visitAllObjects<T>(
- void handler(
- T
- List<
T> expressions, - EmitterVisitorContext ctx,
- String separator, {
- bool newLine = false,
- bool keepOnSameLine = false,
Implementation
void visitAllObjects<T>(void Function(T) handler, List<T> expressions,
EmitterVisitorContext ctx, String separator,
{bool newLine = false, bool keepOnSameLine = false}) {
const _MAX_OUTPUT_LENGTH = 80;
var length = expressions.length;
for (var i = 0; i < length; i++) {
handler(expressions[i]);
if (i != (length - 1)) {
// Place separator.
ctx.print(
separator,
keepOnSameLine
? ctx.currentLineLength > _MAX_OUTPUT_LENGTH
: newLine);
}
}
if (newLine) {
ctx.println();
}
}