visitWhileLoop method
Implementation
@override
StringSink visitWhileLoop(WhileLoop loop, [StringSink? output]) {
output ??= StringBuffer();
if (loop.label != null) {
output.writeln('${loop.label}:');
}
if (loop.doWhile) {
output.writeln('do {');
if (loop.body != null) {
loop.body!.accept(this, output);
}
output.write(' } while (');
loop.condition.accept(this, output);
output.write(');');
} else {
output.write('while (');
loop.condition.accept(this, output);
output.writeln(') {');
if (loop.body != null) {
loop.body!.accept(this, output);
}
output.write(' }');
}
return output;
}