visitDoStmt method

  1. @override
String visitDoStmt(
  1. DoStmt doStmt
)
override

Implementation

@override
String visitDoStmt(DoStmt doStmt) {
  final output = StringBuffer();
  output.write(_lexicon.kDo);
  final loopString = formatAST(doStmt.loop);
  output.write(loopString);
  if (doStmt.condition != null) {
    final conditionString = formatAST(doStmt.condition!);
    output.write(' ${_lexicon.kWhile} ');
    output.write(conditionString);
  }
  if (doStmt.hasEndOfStmtMark) {
    output.write(_lexicon.endOfStatementMark);
  }
  return output.toString();
}