parseWhile method

Statement parseWhile()

Implementation

Statement parseWhile() {
  int? line = token!.line;
  int? start = token!.startOffset;
  assert(token!.text == 'while');
  consume(Token.NAME);
  consume(Token.LPAREN);
  Expression condition = parseExpression();
  consume(Token.RPAREN);
  Statement body = parseStatement();
  return WhileStatement(condition, body)
    ..start = start
    ..end = endOffset
    ..line = line;
}