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