visitWhile method

  1. @override
dynamic visitWhile(
  1. WhileStatement node
)

Implementation

@override
visitWhile(WhileStatement node) {
  final String? loopLabel = _nextStatementLabel;
  _nextStatementLabel = null;
  while (toBoolean(getValueFromNode(node.condition))) {
    try {
      node.body.visitBy(this);
    } on ControlFlowBreakException catch (e) {
      if (e.label == loopLabel) break;
      if (e.label != null) rethrow;
      break;
    } on ControlFlowContinueException catch (e) {
      if (e.label == loopLabel) continue;
      if (e.label != null) rethrow;
      continue;
    }
  }
}